Pretty much what I’m trying to do it send the currently playing iTunes track to an arduino via a serial port (with SerialPort X). I had a few questions about applescript.
- is it possible to open a dialog and run code in the background? I’d like to open a dialog that says “running” and you can click a button called something like “stop” and it will stop running through a loop.
kinda like:
display dialog "sending track data" buttons {"stop"}
repeat until --[stop pressed]
[code ]
end repeat
I need to do this to play nice with the serial port (close it when I’m done); otherwise I have to quit applescript editor. I’m not sure how this will work out when I export it as an application.
- is there a way for the script to only update when the current song changes? i.e. get data for the current track, send it, then wait / delay until the track changes, then send the data again? I could do this with a loop in the applescript I guess, but is there a way iTunes can tell the applescript the song has changed?
Cheers,
Andy