Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call method for NSTimer



On 1/31/06 12:17 PM, "Mark Lively" <email@hidden> wrote:

> I created a simple ASS application.
> 
> 
> on idle theObject
> display dialog 1
> tell application "Finder" to delay 5
> display dialog 2
> return 1
> end idle
> 
> It display both dialogs 5 seconds apart.
>

I extracted the delay matter from the script in my AS_Studio app which was
displaying the error when I tred to let the Finder do the delaying, and from
what I can tell it's as simple as this:

on process_something()
    do_it
    run_delay(2)
end process_something


on run_delay(the_delay)
   tell application "Finder" to delay the_delay
end run_delay

When I constructed a new sample AS_Studio app similar to your two dialog
boxes with the above, continuing to omit the idle handler, no error was
displayed. I didn't understand that, so, assuming that the difference might
be related to the fact that my previous application had an idle handler but
the new one didn't, I changed the delay matter in my application to this.


property delaytime : missing value
property delayer : false

on idle
if delayer
tell application "Finder" to delay delaytime
set delayer to false
else
do idle stuff
end if
end idle

on process_something()
do_it
run_delay(2)
end process_something

on run_delay(the_delay)
set delaytime to the_delay
set delayer to true
end run_delay

That lets my application let the Finder do the delaying without triggering
the error. It appears the problem is solved, so thanks!

But what solved it? Is it that if you have an idle handler, you'd better put
your delay commands inside it, even if you're letting Finder do the
delaying?

Laine Lee 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Re: Call method for NSTimer (From: Mark Lively <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.