StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Lua Scripts
 General Action Scripts
 Closing Apps

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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.

Let me know if this works for you.

StrokesPlus Forum © 2011-2012 Rob Larkin Go To Top Of Page
Snitz Forums 2000