AutoHotkey Community

It is currently May 27th, 2012, 11:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: CLOSING AHK SCRIPTS
PostPosted: October 25th, 2005, 12:31 am 
Offline

Joined: September 12th, 2005, 10:35 pm
Posts: 216
If i have 3 scripts like

a.ahk , b.ahk and c.ahk

CAN IT BE CREATED

1)A command line utility

OR

2) An ahk script

to close all those scripts?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2005, 1:21 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
See ExitApp or Process(, Close)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2005, 1:42 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
This is also in the FAQ:
Code:
DetectHiddenWindows On  ; Allows a script's hidden main window to be detected.
SetTitleMatchMode 2  ; Avoids the need to specify the full path of the file below.
WinClose Script's File Name.ahk - AutoHotkey  ; Update this to reflect the script's name (case sensitive).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2005, 9:57 pm 
Offline

Joined: September 12th, 2005, 10:35 pm
Posts: 216
THANK YOU


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2005, 11:24 pm 
Offline

Joined: October 7th, 2005, 9:46 pm
Posts: 13
Here is a script that will close all running AutoHotkey scripts in XP.
Code:
IfExist, c:\existing.txt
  FileDelete, c:\existing.txt
RunWait, %comspec% /c tasklist /fo csv /fi "imagename eq AutoHotkey.exe" >>c:\existing.txt,,Hide
Loop, read, c:\existing.txt
{
  if a_index > 2
  {
    StringSplit, PIDArray, A_LoopReadLine, `,
    StringReplace, PIDArray2, PIDArray2,",,All
    Process, Close, %PIDArray2%
  }
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2005, 12:18 am 
Offline

Joined: October 7th, 2005, 9:46 pm
Posts: 13
On the above script..

It won't close compiled scripts.
It will close itself, unless you use Process, Exist to find the current PID, then check for that in the read loop.

If anyone sees a problem or can suggest something better, let me know.
Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2005, 3:06 am 
Offline

Joined: September 12th, 2005, 10:35 pm
Posts: 216
Sorry, am not using XP, am using 98


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, MSN [Bot], nightang and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group