|Mar 25, 2013, 09:02 PM||#1|
Doubts About Running Applescript On Background
I'm writing a little Applescript which waits for a window to open in order to close it automatically.
The things is, how can I wait for the window to open? I don't want to run an endless loop which checks for a window with a certain title...
Could anyone give me some directions on how to achieve this in the most efficient way?
Thanks on beforehand, any help would be appreciated!
|Mar 26, 2013, 12:33 AM||#2|
What window are you waiting for to open?
If your Applescript is opening the window, then I see no issue with just inserting a 0.3 delay after opening the window and having it close the window at that point... I know I've done exactly that before.
Don't tell me Macs don't last: 2007 iMac, 2007 Mac Mini, 2008 MacBook Air, all Vintage.
(iMac obsoletion: April 28, 2015, MBA: October 14, 2015, Mac Mini: March 9, 2016)
|Mar 26, 2013, 09:56 AM||#3|
The window is opened by another application.
This window will appear when a user clicks a certain button so, how wait for that without using 100% cpu ?
For testing purposes I put my code into an endless repeat loop and it works, but cycling endlessly through the script is nor efficient nor elegant IMO.
I hope I clarified the script scenario a bit better this time.
Just in case someone thinks I just want someone to code for me that's not the case. Any hints on a workaround/solution will be appreciated, I will investigate further on by myself and update this post so it works as a future reference for others
Current Loop Code:
Last edited by DonK KijotE; Mar 26, 2013 at 12:06 PM.
|Mar 27, 2013, 03:24 PM||#4|
Is your Aplescript run once or is it a stay open Applescript ?
If its a stay open Applescript then you could use an on idle Handler.
on idle -- perform periodic tests return 1 -- return the number of seconds between the next on idle call end idle
|Mar 27, 2013, 03:32 PM||#5|
Pay for the software that is periodically popping up a window asking you to pay for it periodically will make it go away.
Obama is a true statesman whose experience as a state senator, half-term US Senator & guest lecturer in a Constitutional Law class has fully prepared him to take control of our nuclear arsenal.-Me
|Mar 29, 2013, 03:23 PM||#6|
The thing is I want to perform the routine above explained only when I click a certain button in the software, it's precisely when it's idle that I don't want it to do anything, just wait for me to click and open the referred window...
If I'm not understanding your point correctly let me know
Thanks on beforehand!
I see the user who posted right after you and I don't even know what he's talking about...
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Running an AppleScript at a specific time||rediffusion||Mac Programming||4||Jan 7, 2014 10:09 PM|
|running videos in background?||eclipse01||iOS 7||0||Sep 30, 2013 12:36 PM|
|How to tell if apps are running in the background||chele519||iPhone||17||Sep 26, 2012 09:13 PM|
|Messages always running in background?||stark4||OS X 10.8 Mountain Lion||4||Aug 22, 2012 12:03 PM|
|My Applescript is running like a dog under ML||lloyd709||OS X 10.8 Mountain Lion||0||Jul 26, 2012 11:27 AM|
All times are GMT -5. The time now is 03:13 AM.