In v1.1, you could quickly test to see if a process was running using Process, Exist, eg. Process, Exist, Autohotkey.exe. The Process command and its subcommands have been removed in v2, ostensibly to be replaced by individual commands.
There appears to be no direct individual replacement for Process Exist in v2. You can build an array of open windows (including hidden ones) using WinGetList and enumerate that to find full paths using WinGetProcessPath. Each array item can then be checked against the process you are interested in. This is slow and clumsy. Am I right in thinking that there is no direct replacement for Process Exist and, if so, will a new command be created in v2?
Replacement for Process Exist command
Re: Replacement for Process Exist command
Where are you looking for v2 changes? Did you read the Alphabetical Command and Function Index of the v2 documentation?
Re: Replacement for Process Exist command
Process Exist was replaced with ProcessExist. Obviously.
I didn't list WinGetProcessPath in v2-changes either, yet you worked that one out.
Actually, I neglected to mention in v2-changes that the Process functions/commands now use a return value/OutputVar instead of ErrorLevel, but it is detailed in the full documentation.
I didn't list WinGetProcessPath in v2-changes either, yet you worked that one out.
Actually, I neglected to mention in v2-changes that the Process functions/commands now use a return value/OutputVar instead of ErrorLevel, but it is detailed in the full documentation.
You can, but why would you? If you're going to limit it to processes which own windows, you can just use WinExist() with ahk_pid/ahk_exe. That aside, Process Exist never supported "full paths", only process names, so WinGetProcessName would be more appropriate.Ciceroids wrote:You can build an array of open windows (including hidden ones) using WinGetList and enumerate that to find full paths using WinGetProcessPath. Each array item can then be checked against the process you are interested in.