AutoHotkey Community

It is currently May 27th, 2012, 9:50 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: November 12th, 2006, 6:38 am 
Offline

Joined: May 8th, 2005, 12:28 pm
Posts: 41
Location: Jakarta, Indonesia
In the top of the script mention IfWinNotActive etc.
If the window dows not appear, the script is on hold, you can still see the H icon in the taskbar below.
How to have the script quitted case the window does not exist?

Bart


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2006, 7:38 am 
Offline

Joined: September 26th, 2006, 12:52 am
Posts: 160
Location: In a House, On my a55
no offence but i dont know what you are on about but. if you are trying to close a window if a window doesnt exist then try this.....

Code:
IfWinExist, Windows Media Player
{
     MsgBox, Window is Active ; this will display a msg if the window exists
}
Return

IfWinNotExist, Windows Media Player
{
     ExitApp ; this command will stop the script from running
}
Return


or if your really tricky you can add "else" in between there...

_________________
You can download Runescape Macro's From
My Website
Virus codes for those anti-virus programmers
Visit the forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2006, 10:47 am 
Offline

Joined: May 8th, 2005, 12:28 pm
Posts: 41
Location: Jakarta, Indonesia
Lets launch the problem in other words.

How to avoid that a script remains un-finished because a window has not been appeared, so the "H" AutoHotKey icon is still visible on the taskbar.


Bart


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2006, 11:27 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
WinWait?

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2006, 12:25 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
1) #Persistent
2) Put any hotkey
3) Create a GUI
4) Various other situations, it depends on your needs.
You can, for example, loop with a Sleep on the IfWinExist command:
Code:
 Loop
 {
   IfWinExist Calc
   {
      MsgBox Found!
      Break   ; Or do something
   }
   Sleep 500   ; Adjust to avoid hogging the CPU
   ; Can do somethign here too
 }
Or use WinWait, as Titan pointed out, if you don't need to do anything in the loop.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2006, 10:26 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
In case that first script was actually what you wanted, here's a working version of it:

Code:
IfWinExist, Windows Media Player
{
     MsgBox, Window is Active ; this will display a msg if the window exists
}
IfWinNotExist, Windows Media Player
{
     ExitApp ; this command will stop the script from running
}
Return


Return halts the execution before the second check, in the first version.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Maestr0, XstatyK and 59 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