Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
p_ewing
Posted - 04/05/2012 : 01:57:41 If I wanted to close an app, say thunderbird.exe Do I use acCloseApplication or acTerminateProcess? And how do you use them?
1 L A T E S T R E P L I E S (Newest First)
Rob
Posted - 04/05/2012 : 09:03:16 Do you mean where Thunderbird isn't the foreground window (like using the included Close Program action)?
I admit, it does seem that closing a program by using the executable's name is something that S+ should have a direct action for. I'll have to add that to the TO DO list. In the meantime, I tested this script and it seemed to work for me:
local iHandle = 0 iHandle = acFindWindowByTitleRegex(".*Mozilla Thunderbird") if iHandle > 0 then acCloseApplication(iHandle, 0, 0) end
What it does is find the Thunderbird window by matching the window title to the regular expression pattern (".*Mozilla Thunderbird"), then passing the handle of the Thunderbird window to acCloseApplication. You could pass it into acTerminateProcess, but I only recommend using that action for when you want to force kill a process, not just exit the program normally.