Re: Problem with DELAY
Re: Problem with DELAY
- Subject: Re: Problem with DELAY
- From: Emmanuel LEVY <email@hidden>
- Date: Tue, 14 Jan 2014 19:33:12 +0100
Not AS-related, I found an article entitled "How to disable App Nap" there: http://www.tekrevue.com/tip/disable-app-nap-os-x-mavericks/
Best,
Emmanuel
On Jan 14, 2014, at 7:25 PM, Steve Bird wrote:
> My script basically does the following (pseudo code shown here), in an endless loop:
>
> repeat
> Tell app “Safari”
> For each window
> for each tab in this window
> if qualified (URL of this tab)
> Check contents of page
> if changed
> update TextEdit window for this page with summary.
> end if
> end if
> end for
> end for
> Delay (1)
> forever.
>
>
> IOW, it scans the open web pages for certain types (from a certain site) and if found, scans those pages for changes. When the pages change, the TextEdit summary page is updated to reflect that.
>
> This all works fine
> EXCEPT
> When Safari or TextEdit or something else is frontmost, the lag between the page updating and the summary updating will start to get longer and longer and longer. When it does update, it updates all the way, but it just waits longer and longer.
>
> All my debugging says that it’s NOT in the processing to detect changes - it’s in the DELAY.
>
> It acts as if the DELAY were getting longer and longer.
>
> If I build an APP, it behaves the same way.
>
> When it is in the stall like that, I can click on the script window, or otherwise bring ASE to the front, and it updates instantly, as if it realized it was behind and decided “Oh, I better quit goofing off”.
>
> When running the app, if I bring the app to the front, it likewise catches up. As long as ASE (or the app) is frontmost, it works fine. But a few seconds after something else comes in front, it tries to get away with not doing what I ask.
>
> What am I missing?
> Is there a better way to keep the thing working while it’s not frontmost?
>
> This is in Mavericks - I never noticed this behavior in 10.6, but I won’t swear that it wasn’t there.
>
> ----------------------------------------------------------------
> Steve Bird
> Culverson Software - Elegant software that is a pleasure to use.
> www.Culverson.com (toll free) 1-877-676-8175
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden