I develop software for disabled kids. I use Macromedia’s old Director (now owned by Adobe). I wish to control an audio cd in the drive from Director. In order to do so in OS X, I need a way for Director to do this. I can run an Applescript from Director but I have no Applescript experience. I don’t want to go ‘through’ iTunes, if I can help it. Is there a way to have Applescript control the audio CD directly?
Those are the controls I would need.
Please cc <email@example.com?
AppleScript is more like unix shell scripting than like programming - it doesn’t really “do” much by itself, it’s designed to act as the glue between other programs.
You might be able to find an AppleScript add on to let it control the CD directly, but then you’d have to get it installed on every computer you installed your software on and I assume that’s not any more feasable than having iTunes installed on every computer? You could use any other scriptable program that plays music really, since audio CDs show up in the file system as having AIFF files on them, Quicktime Player is ubiquitous would do the trick I think although I haven’t got a music CD handy to try it.
Why is it that you don’t want to use iTunes to execute the commands? It’s installed on every OS X computer sold as far as I know, so even if the person who has the computer doesn’t usually use it it will still be available to you in the overwhelming majority of cases. Knowing what the limitation was should make solving the problem easier.
There is a Unix executable called “Play” by Patrick Machielse of Hieper Software that will play anything that Quicktime will play. I wrote a tutorial on shell scripts some time ago now: Tutorial: Some Lessons & Fun with “do shell script…” in AppleScripts which uses Play. It’s the last example in the article.
Here’s an example:
-- NOTE: press the escape key to quit a song in progress
set tMusic to quoted form of POSIX path of (path to music folder)
set Play to quoted form of POSIX path of ((path to scripts folder from user domain as text) & "ShellScpt:PlayScript:Play") -- path to "Play"
set Song to quoted form of POSIX path of "GDead:1.08 Me & My Uncle.mp3" -- path to the song to be played within the Music folder
-- Do it!
do shell script Play & space & tMusic & Song