Programming Languages-Other

20K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello experts,

I used the following hotstring in my AutoHotkey/Hotstring file:
#G::
#!G::
#!R::
They also refer to keyboard shortcuts of Xbox Game, coming as default with Win10.
https://support.microsoft.com/en-us/help/4026387/windows-10-keyboard-shortcuts-for-xbox-game-bar
I don't use Xbox as a result I would like to get ride off them.
When I call the AutoHotkeys related to them, I also activate Xbox shortcuts, behavior that I want to avoid.
Normally this is not the case for the other applications as AutoHotkey surpass other default shortcuts and turn them off.

If you have advice and recommendations on how to manage this and also if you have some feedback and best practices on how to avoid hotstrings and keyboards conflicts, please let me know.

Thank you very much for your help.
0
Exploring SQL Server 2016: Fundamentals
LVL 19
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Need help to update this Autohotkey script to add the hour, minute and second to the generated result.  

If possible, prefer AM & PM.  If not, then 24-hour format is fine:

^#q::
FormatTime, CurrentDateTime,, yyyy.M.d-'A'
SendInput %CurrentDateTime%
return

Open in new window


Amy thanks!

OT
0
Hello experts,

Following the question:
https://www.experts-exchange.com/questions/29162274/AutoHotkey-eject-usb.html


I would like to review the specs :

1.      Instead of entering the letter to eject specific USB drivers, I would like to have a single AutoHotkey shortcut key to eject all the connected USB drivers available in my computer.
2.      Remove the part related to access the USB drivers.

I attached last proposed solution.

If you have questions, please contact me.

Thank you for your help.
EjectDriveV2.ahk.txt
0
Hello experts,

I was wondering if there is a way to set up a AutoHotkey key to eject usb.

Thank you for your help.
0
Example of a Neural Network?

I am interested to know what I can do with Neural Networks and hope to see an example.

Got any?

Thanks.
0
Question about AI technologies to solve this "learning" challenge

I am new to AI and have had no real experience coding anything related to Natural Language Processing. But, I am eager to jump in!

I need to find a method that I can find the following two options have a high match:

#1 Frank's First Car was a Red Chevy

#2
Frank has never had more than one car
Frank would only buy a red car
Frank comes from a family that only buys Chevy's

#3
Frank has never owned a car

Are there a combination of AI technologies which can:
1) parse these statements
2) preserve them in some fashion
3) Allow them to be organized such that the comparison between #1 vs. #2 returns a very high match (90+%) versus #2 vs. #3

I am interested to see if such tool and languages exist for this.

Thanks
0
Hello experts,

I was wondering how to display the wireless networks dialog box through AutoHotkey.
If you have advice on this please let me know.

Thank you for your help.
20191009_125719-screenshot.png
0
Hello experts,

The following procedure allows me to remove extra blank lines.

^!Space::
  ; clipboard:="" ; Joe commented out - not needed because Ctrl+c replaces Clipboard
  ;~ Send, ^a ; Luis commented out because he prefers to select the block
  Send, ^c
  ClipWait,1 ; Joe added - good practice to do a ClipWait after Ctrl+c
  If (ErrorLevel=1)
  {
    MsgBox,4144,Error,No text appeared on clipboard after waiting for one second
    Return
  }
  Clipboard:=RegExReplace(Clipboard,"\R\R\K\R+") ; replace two or more consecutive blank lines with a single blank line
  sleep 100
  ; Joe: see if last two chars are CR and/or LF
  LastChar:=SubStr(Clipboard,0,1)
  If ((LastChar="`r") or (LastChar="`n"))
    StringTrimRight,Clipboard,Clipboard,1
  If ((LastChar="`r") or (LastChar="`n"))
    StringTrimRight,Clipboard,Clipboard,1
  
  Send, ^v
  Return

Open in new window


I noticed that removal is not performed when blank lines starts with a space.

Example of block text:

text


 
text with extra blank lines above.

Could you please help me to adjust the AutoHotkey to be able to remove extra blank lines even if they start with a space?

Thank you for your help.
0
Hello,

I am trying to send a click to close document recovery pane button in excel .
The objective is to close the process through reading the image however for the moment I want to understand why click is not applied. I attached a video.
Could you please advice me on how the click should be performed?
I don’t know how to make the click work.


Thank you for your help.


:*:drx::
If (winactive("ahk_exe excel.exe"))
{
  
  WinMaximize
  Sleep, 200
  Click, left,235,1120,4
  Return
}
else
  MsgBox,4112,Fatal Error, Program not supported
Return

Open in new window



Thank you for your help.
20191003_175954-testing-document-reco.7z
0
Hello experts,

I was wondering if there is a way to mute and unmute sound through AutoHotkey.

Thank you for your help.

mute-unmute_20191003_113435.png
0
Bootstrap 4: Exploring New Features
LVL 19
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Hello experts,

I set up the following AutoHotkey script on the basis of the following question:
https://www.experts-exchange.com/questions/29157425/Autohotkey-Open-edit-file-based-on-file-extension.html
+^F1::
FormatTime, CurrentDateTimeFileSelected,, yyyyMMdd_HHmmss
FileSelected:=GetSelectedFile()
SplitPath,FileSelected,FileNameSelected,FileDirectory,FileExtension
NewFileName:= SubStr(FileNameSelected,1, -5) . "_" . CurrentDateTimeFileSelected . "." . FileExtension 
;~ FileCopy, %FileSelected%, 
NewFile:=FileDirectory . "\" . NewFileName
Msgbox %NewFile%
FileCopy, %FileSelected%, %NewFile%

GetSelectedFile(hwnd="") {
; this function by sinkfaze: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=77#p395
 WinGet, process, processName, % "ahk_id" hwnd := hwnd? hwnd:WinExist("A")
 WinGetClass class, ahk_id %hwnd%
 if (process = "explorer.exe")
 if (class ~= "Progman|WorkerW") {
 ControlGet, files, List, Selected Col1, SysListView321, ahk_class %class%
 Loop, Parse, files, `n, `r
 ToReturn .= A_Desktop "\" A_LoopField "`n"
 }
 else if (class ~= "(Cabinet|Explore)WClass") {
 for window in ComObjCreate("Shell.Application").Windows
 if (window.hwnd==hwnd)
 sel := window.Document.SelectedItems
 for item in sel
 ToReturn .= item.path "`n"
 }
 return Trim(ToReturn,"`n")
}
Return

Open in new window


Prior to adding to my AutoHotkey file I have some questions:
1-I used the GetSelectedFile function in another AutoHotkey script declare in my AutoHotkey file. What is the best practice:
Have just a single function for the various AutoHotkey scripts that use it and place the function at the end of the file? Or declare the function every time when an AutoHotkey script use it? I supposed the first option is the best but I would like to have a confirmation.
2-Could you please confirm the structure of the AutoHotkey and if you have additional advice or another best way to copy and rename file please let me know. For example where should I add an error level condition?

I attached a video to illustrate that it works here in an OS 10.
Thank you for your help.
copy-rename-file_20190928_234539.7z
0
Hello experts,

The following script allows me to send style code based on a selection:


!^c:: ;code
Send, ^x
Send, Sleep, 50 ClipWait,1 If (ErrorLevel=1) { MsgBox,4144,Error, No text appearing after one second Return } Send, ^v Sleep, 50 Send, {End} Sleep, 50 Send, Return


Instead of selecting and go to initial position I thought that the best is to simplify it as following through using directly by the clipboard:


!^c:: ;code
Send, ^c
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
ClipboardVar:=Clipboard
Clipboard:="" . ClipboardVar . ""
Sleep, 50
MsgBox,4160,Success,Your clipboard has been properly copied.
Return


Prior to adding to my AutoHotKey file could you please let me know your advice on the script structure and if I can go ahead by adding this on my AutoHotKey file.

Thank you very much for your help.
0
Hello experts,
I set up the following AutoHotkey to hide and show windows by class.
I took as a reference the AutoHotkey reported at https://www.experts-exchange.com/questions/29159194/AutoHotkey-WinHide.html#a42949009
:?*:hhx::
HideClass:="Chrome_WidgetWin_1" ; title must contain this - case insensitive
WinGet,AllWindows,List ; get list of all windows that exist
NumWin:=AllWindows ; number of all windows
NumHidden:=0 ; number of windows hidden
Loop,%NumWin% ; loop through all windows
{
  Handle:=AllWindows%A_Index% ; get the handle of each window
  WinGetClass,Class,ahk_id %Handle% ; get the class of each window
  If (InStr(Class,HideClass)) ; "contains" match and case insensitive
  {
    WinHide, ahk_class %Class% ; hide the window if it matches
    NumHidden:=NumHidden+1 ; increment number of windows hidden
  }
}
MsgBox,4160,Number Hidden: %NumHidden%,Done hiding windows that contain this in the Class:`n`n%HideClass%
Return

:?*:ssx::
DetectHiddenWindows,On ; so that WinGet finds the hidden windows
ShowClass:="Chrome_WidgetWin_1" ; Class must contain this - case insensitive
WinGet,AllWindows,List ; get list of all windows that exist
NumWin:=AllWindows ; number of all windows
NumShown:=0 ; number of windows shown
Loop,%NumWin% ; loop through all windows
{
  Handle:=AllWindows%A_Index% ; get the handle of each window
  WinGetClass,Class,ahk_id %Handle% ; get the class 

Open in new window

0
Hello experts,
I am trying to performed a WinHide however I don't understand why it doesn't work:
:?*:hhx::
WinGetActiveTitle,Title
If (InStr(Title,"Title"))
{
	Sleep,500
	PostMessage,0x112,0xF030,,,%Title%
	WinHide,%Title%
	Msgbox,,, WinHide has been performed
	Return
}
Else
MsgBox,4144,,WinHide cannot be performed as the title of ActiveWindows doesn't match.
Return

Open in new window


When I performed the same opertation with:
WinClose, %Title%

Open in new window

Thank you for your help.
0
Hello experts,
I would like to move on ahk studio as I am not fully satisfied with sciTE4AutoHotkey.
I follow instruction and download reference zip file at:
https://github.com/maestrith/AHK-Studio/archive/master.zip
I run ahk file:
ahk-studio-master_20190924_142614.pngHowever I don't know how to:
1-Open with (by default) .ahk file with ahk studio. Where should I place the AHK-Studio-master folder?
open-with-ahk_20190924_142836.png2-I also don't see ahk studio in my programs features.
20190924_142906-programs.pngI supposed that this is due to the fact that it is not a compiled version.
3-I have also the following script which allows me to edit by default .ahk files.
https://www.experts-exchange.com/questions/29157425
It open by default .ahk file with sciTE4AutoHotkey I would review it to open with ahk studio.
;====================================
;Edit file based on extension
;====================================

#NoEnv ; avoid checking empty variables to see if they are environment variables. Potential regressions if so comment this line
#SingleInstance Force ; replace old instance immediately
SetBatchLines,-1 ; run at maximum speed

+F4::
FileSelected:=GetSelectedFile()
SplitPath,FileSelected,,,FileExt
If (FileExt="ahk")
 Run,%SciTE4exe% %FileSelected%
Else
 Run,%NPPexe% %FileSelected%
Return

GetSelectedFile(hwnd="") {
; this function by sinkfaze: 

Open in new window

0
Hello experts,
I set up the following AutoHotkey to send clipboard on google drive and upload files.
+F9::
FilePath1:=Clipboard
FilePath2:=StrReplace(FilePath1, """")
If (Not FileExist(FilePath2))
{
	Msgbox,0x10,Error, Your clipboard which report the following value %FilePath2% doesn't exist	
	Return
}
Else
Msgbox,0x40,Success, Your clipboard which report the following value %FilePath2% exist	
WinGetActiveTitle,Title
If (InStr(Title,"Google Drive"))
{
	PostMessage,0x112,0xF030,,,%Title%
	Sleep, 100
	Send, mc 	
	Sleep, 100
	Send, {Down 2}
	Sleep, 100
	Send, {Enter}
	Sleep, 1500
	WinGetActiveTitle,Title
	If (InStr(Title,"Open"))
	{	
		Send, %FilePath2%
		Sleep, 100
		Send, {Enter}
		Return
	}
	Else
	MsgBox,0x10,Error,Unable to send path as active window doesn't contains name expected
	Return
}
Else
  MsgBox,0x10,Error,Google Drive is not the active window
Return

Open in new window


I made a test with the following cases and it works:
1-Error when clipboard doesn't contain a file which exist
2-Success when the clipboard contain a file which exist
3-Error when google drive is not the active windows

Prior to adding to my AutoHotkey file I would like to have some advice to see if the AutoHotkey should be revised in term of structure, conditions and loops.
I am aware that Send keys is not the best way however this is how I can work on google drive.

Thank you for your help.
0
Hello experts,
I would like to understand why winmaximize works in some case and not in other case.

WinMaximize is applied as followed:

^+F12::
If(WinActive("ahk_exe chrome.exe"))
{
	WinMaximize
	Return
}
Else
  MsgBox,4144,Error,Google Drive is not the active window
Return

Open in new window


However it doesn't work as followed:
^+F12::
WinGetActiveTitle,Title
If (InStr(Title,"Google Drive"))
{
	WinMaximize
	Return
}
Else
  MsgBox,4144,Error,Google Drive is not the active window
Return

Open in new window

Thank you for your help.
0
Hello experts,
I need to launch an AutoHotkey once I turn on my machine:
The idea is to place the following at:
AutoCorrect1:="C:\P\LD-autocorrect.ahk"
AutoCorrect2:="C:\F\LD-autocorrect.ahk"

If (FileExist(AutoCorrect1))
  Run,%AutoCorrect1%
Else
If (FileExist(AutoCorrect2))
  Run,%AutoCorrect2%
Else
  MsgBox,4112,Fatal Error, AutoCorrect does not exist on your system.
Return

Open in new window


I am aware that I can put: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
However I need to add some text at this file as a result I cannot place this file at this folder.

What is the best strategy:
1-Put a single AutoHotkey file at: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup to  automatically call autocorrect?
2-Create an AutoHotkey within my AutoHotkey file to run the autocorrect file? such as #!a:: however I need to remind every time that I need to launch this AutoHotkey to use autocorrect

Thank you for your help.
0
Hello experts,
I am trying to build the following AutoHotkey to send current dir based on Notepad ++ or Powershell:
:?*:cdx::
If (WinActive("ahk_exe notepad++.exe"))
{
  CurrentDirBlock:= "set CurrentDir=`%~dp0 `n" 
                  . "Rem Example: Base=%CurrentDir%Subfolder"
}          
If (WinActive("ahk_exe powershell_ise.exe"))
{
  CurrentDirBlock:= "$CurrentDir = Split-Path $script:MyInvocation.MyCommand.Path `n"
                    . "#Example: $Root = $CurrentDir + '\Root2'"
}
SendRaw %CurrentDirBlock%
Else
  MsgBox,4144,Error,Active window is not a supported program
Return

Open in new window

I don't understand why I have an error message If I put the final Else:
ELSE with no matching IF
And if I remove it I am able to launch the script.
If you have advice please let me know.
Thank you for your help.
0
Learn Ruby Fundamentals
LVL 19
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Hello experts,
I have the following AutoHotkey which allows me to send a comment block:
:*:blc::
FormatTime,CurrentDateTime3,,yyyy/MM/dd HH:mm:ss
If ((WinActive("ahk_exe excel.exe")) or (WinActive("ahk_exe vbsedit.exe")))
  CommentBlock:="' *************************************************************************`n"
              . "' Author: `n"
              . "' Creation date: " . CurrentDateTime3 . "`n"
              . "' Description:`n"
              . "' ***************************************************************************`n"
Else
If (WinActive("ahk_exe notepad++.exe"))
  CommentBlock:="Rem ======================================================================`n"
              . "Rem Author: `n"
              . "Rem Creation date: " . CurrentDateTime3 . "`n"
              . "Rem Description:`n"
              . "Rem ======================================================================`n"
Else
If (WinActive("ahk_exe powershell_ise.exe"))
 CommentBlock:="# ===========================================================================`n"
              . "# Author:  `n"
              . "# Creation date: " . CurrentDateTime3 . "`n"
              . "# Description:`n"
              . "# ===========================================================================`n"
Else
If (WinActive("ahk_exe sciTE.exe"))
 CommentBlock:=";====================================`n"
              . ";`n"
              . ";====================================`n"
Else
If (WinActive("ahk_exe

Open in new window

0
Hello experts,
I am trying to understand the logic behind WinMaximize however the documentation available at:
https://www.autohotkey.com/docs/commands/WinMaximize.htm
is not enough for me.
The need is to set a WinActive condition, maximize and send a click:
Like this:
If (WinActive("ahk_exe ssms.exe"))
{
 WinMaximize
 MouseClick, left, 55, 233
 Return
}
Else
{
  MsgBox,4144,Error,Active window is not a supported program
  Return
}

Open in new window

Thank you for your help.
0
Hello experts,
I was wondering how to make an opposition of If WinActive:
I read documentation related to WinActive:
here
but they don't recommend IfWin[Not]Active
Deprecated: This command is not recommended for use in new scripts. Use the WinActive function instead.
Can I make an Else instead like this:
:*:ahk::
If (WinActive("ahk_exe sciTE.exe"))
;~ Do nothing
Else 
{
Send, AutoHotkey
}
Return

Open in new window

Thank you for your help.
0
Hello experts,
I have the following AutoHotkey which allows me to send Alt + Y1 to directly select my Add-in tab on Excel .
I don't understand why it works one computer equipped by Win 10 Excel 2019 and it doesn't on my other computer equipped by Win 10 Excel 2016.
!y::
SetKeyDelay , 10 ; time to wait between send
WinGetActiveTitle, Title
IfInString, Title, Excel
{
	Send, !Y
 Send, 1
}
Return

Open in new window


Any recommendation or advice?
Thank you for your help.
0
Hello experts,
I would like to set up an AutoHotkey script to swiftly manage the following EE processes executed on a regular basis:
Insert-image which requires 3 mouse click:
Embed-image-1.pngEmbed-image-2.pngAttach a file which requires 3 mouse click:
Attach-file.pngI am aware that mouse click is complicated to manage with AutoHotkey however there must be a smart and swiftly way to manage this.
If you have some feedback and advice on this, please let me know.
Thank you for your help.
1
Hello experts,
I have the following script which allows me to zip file with 7-zip:
;====================================
; 7zip
;====================================

#IfWinActive,ahk_class CabinetWClass
+F7::
Send, +{F10}
Sleep, 100
Send, 7
Return
#If

Open in new window

2019-09-13_16h25_09.pngMost of the time it works however sometimes,
Send, 7 

Open in new window

is not performed and I just get:
2019-09-13_16h26_40.pngIf you have recommendations on this, please let me know.
0

Programming Languages-Other

20K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.