Newbie Help - "Time events"

Hi guys,

I’ll first start off by saying I’m a noob at Applescript studio, I’ve just completed a beginners course, and my most complicated application has been to set up a window with different tabs that can calculate a mortgage lol.

What I’m trying to do here is build a sequencer, and I need a way of expressing the following:

every 100th of a second
(Do action)

How would I go about creating a condition like the one above? Thanks a lot in advance!

-Mel.

Model: G4
AppleScript: 1.4.1
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi,

how about this:

repeat
delay 1.0E-3
beep
end repeat

Hi Thanks for the reply!

I tried that but because it was a consant loop all other interaction is ignored. (ie, you cant click any buttons, etc) Any way round that?

Thanks!

-Mel

Hi again,

Yeah, sorry, just had a quick play myself and I see the problem. I’ve gotta go home now, but I’ll have another look later.

Kev

As you’ve found, repeat loops stop execution of the app. The only application-level method you could use is the idle handler, but per the idle doc’s you should “always return a value of 1 or greater” as the idle interval. I assume that the idle command uses an implementation of NSTimer, which also takes seconds at its interval. I’m not sure what method people use to handle intervals of such a short time, but I am pretty sure that you’re not going to find a solution in applescript studio. Regardless, I don’t think it would be possible, even if you were able to fire in such short intervals. You likely wouldn’t even be able to fire the code to handle the timer in that short time, let alone some more complex code that would actually do something important. The time required to execute the code would overflow the time alloted, and you wouldn’t get reliable results. Sounds like you’re in over your head. :confused:

j