DVD Player Scripting -- chapter change events?

My first question may be a simple AppleScript question. I’ve been writing software for 30+ years and am quite comfortable with numerous scripting languages, mostly in the UN*X environment.

  1. I’d like to trigger a handler upon an event generated by a script-able application. Presumably this would be some sort of “on [event] [i]handler/i” syntax. Is this generally correct?

  2. Specifically with the Apple DVD Player application, I want to write a handler triggered on a DVD “chapter change” event, but I’m unable to find such an event in the DVD Player sdef.

Would I need to “poll” the DVD Player to detect the chapter change? For now, this seems the only approach available.

Thanks in advance,

Hi Jon,

welcome to MacScripter

You’re right, the only way to watch a chapter change in DVD Player with AppleScript is to poll the chapter property.
But it might be possible to create such an event in Objective-C using the DVDPlayback.framework