• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with DELAY
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with DELAY


  • Subject: Problem with DELAY
  • From: Steve Bird <email@hidden>
  • Date: Tue, 14 Jan 2014 13:25:54 -0500

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

  • Follow-Ups:
    • Re: Problem with DELAY
      • From: Emmanuel LEVY <email@hidden>
  • Prev by Date: color and Mail
  • Next by Date: Re: Problem with DELAY
  • Previous by thread: Re: color and Mail
  • Next by thread: Re: Problem with DELAY
  • Index(es):
    • Date
    • Thread