Records redux
Records redux
- Subject: Records redux
- From: "TRELEAVEN, CRAIG" <email@hidden>
- Date: Thu, 01 Mar 2001 13:30:00 -0500
- Organization: Clearview Consulting on assignment at Bell Nexxia
I'm new to AppleScript. The discussion of records has been pretty
interesting and I'm wondering if there is a more elegant way to do the
thing I'm working on. Which is, I'm trying to interface the
"Entertainment Anywhere 2000" kit from X10.com to my Mac. This thing
transmits (by RF) audio or video from the Mac upstairs to the home
stereo downstairs. It has a universal remote that transmits (again RF)
to a receiver attached to the serial port. An applet will wait for
incoming messages and send events to the right players--basically each
key on the remote sends a byte to the computer. Certain keys switch
between playing MP3s, CDs, DVDs, or maybe internet radio.
Could I have 'records' that consist of the key press codes and the
associated script objects (maybe one for each player). Ala
{{176, MP3_Play, CD_Play, DVD_Play}, {112, MP3_Stop, CD_Stop, DVD_Stop},
...}
Each script object would look pretty much like...
On MP3_Play
Tell Application "SoundJam Plus" Play <somethingToBeDetermined>
End On
Is there a slick way to find the key press code (if defined) and execute
the appropriate object? Before finding this list, I was just expecting
to do a big ugly if statement: If myKey = 176 then MP3_Play Else If
... ... Else ... End If
Craig Treleaven