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



NSTimers are used to trigger events to happen in the future.

You have a few options to replace the missing delay.

1) recode the entire thing to use the idle loop where you want to
delay.  This gets REALLY ugly REALLY fast if you have a lot of delays.

2) Tell some other application who can see the standard additions to
delay.  (tell application "Finder" to delay 5)

3) Roll your own

on MarksDelay(n)
set laterTime to (current date)+n
repeat
    if (current date) > laterTime then exit repeat
end
end


On 1/31/06, Laine Lee <email@hidden> wrote:
> I continue to be frustrated with the removal of the delay Applescript
> command for AS-Studio applications. It seems to me that it's getting more
> and more difficult for casual scripters like me to keep their heads above
> the water when it comes to the increasing complexities and encumbrances of
> Xcode.
>
> OK, rant over.
>
> I believe the last chance I have for implementing an acceptable method of
> status reporting in my app may be to implement a call method or idle handler
> for use with the NSTimer function. I started by looking for Xcode examples,
> but I couldn't find what I think I need. I spent a good part of an afternoon
> looking into this, but it's pretty much my first exposure to C except for  a
> few morsels I've been able to pick up and use character for character. This
> is as close as I was able to get:
>
> I tried to replace "delay 2" with
>
> "call method "timerWithTimeInterval:" of class "NSTimer" with parameter 2"
>
> Close?
>
> No?
>
> Help?
>
> Thanks.
>
> --
> 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
>
 _______________________________________________
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: 
 >Call method for NSTimer (From: Laine Lee <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.