Bring window to front
I created a shortcut to open a program. It does cause the program to open, but it doesn't bring its window to the front. How do I make the shortcut open the program and bring it to the front (i.e. make it the active window)? Also, in general, how do you tell the computer to make a particular window the up front active window? Thanks!
This is an operating system issue. Try to use another shortcut (avoid Alt and Win modifiers).
Or use this:
https://www.autohotkey.com/docs/command ... tivate.htm
Or use this:
Code: Select all
Run, "C:\Program Files (x86)\Folder\software.exe",,, OutputVarPID
WinWait, ahk_pid %OutputVarPID%
WinActivate, ahk_pid %OutputVarPID%
The shortcut I am using is the F6 function key. I am trying to have it open C:\Program Files (x86)\Dentrix\Office.exe - I tried to implement your code but I must be doing something wrong because it is giving me an error and won't even let me save it.
You need to use Type: Command.
Hmmm.. it still is not bringing up the window:
Run, "C:\Program Files (x86)\Dentrix\Office.exe",,, OutputVarPID
WinWait, ahk_pid %OutputVarPID%
WinActivate, ahk_pid %OutputVarPID%
Run, "C:\Program Files (x86)\Dentrix\Office.exe",,, OutputVarPID
WinWait, ahk_pid %OutputVarPID%
WinActivate, ahk_pid %OutputVarPID%
Can you try with another software path - does it work?
What happens if you run it using Cmd?
C:\Program Files (x86)\Dentrix\Office.exe
What happens if you run it using Cmd?
C:\Program Files (x86)\Dentrix\Office.exe