[Newbies] Wait for an external app

Sean P. DeNigris sean at clipperadams.com
Sun Nov 7 15:50:05 UTC 2010

While controlling QuickTime Player via Applescript from within the image, I
want to play a CD track until it reaches a certain point.  QTP does not
expose "playTo: aPosition" functionality, so I'm polling the track position
until the time is reached.  I don't want to lock up Morphic, so I'm doing
this in another thread.

The following works, but I've never used threads before and wanted to get
opinions.  What do you think?

    cd play.

    [ [ cd position < endTime ] whileTrue: [ Processor yield ].
         cd pause ] fork.

* "cd position" gets the track position via Applescript
* endTime is a variable holding the time to play until

View this message in context: http://forum.world.st/Wait-for-an-external-app-tp3030911p3030911.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.

More information about the Beginners mailing list