WHOA! AWESOME, t.spoon, that worked! Thank you! The only addition I had to add was to close the serial port.
Some answers to your questions, and then my next step/issue:
Q: I’d need more information to understand if there’s a reason why you have to do it this way
A: I’m trying to do the following, in order: (1) iTunes kicks off AS when song in playlist (all CD changer songs) changes → (2) AS grabs song comments → (3) AS sends Stop command out serial port (USB) to CD changer(s) (4) AS parses/assembles hex codes & commands and sends out serial port with Play command → (5) serial box h/w device routes (#3 & #4) to correct CD changer (6) physical CD plays on CD changer (7) back to #1 —^
Q: Do the commands ever change, or just the hex codes?
A: The hex codes are the commands. Example, within the code (i.e. [1A22C]) it defines which CD changer number (“1”)(I have 4 changers), that they are Pioneer (“A2”)(versus Sony) and number (“2C” = 1). You first send the Disc numbers and then set the disc with [1A21C] and then the Track numbers and set the track with [1A212]. There’s also codes for turning on the changer, set it to program mode, and etc.
Q: I’m guessing that the only information that has to change per track is the codes, not the script commands
A: Correct, CD Changer, Disc, and Track actually.
Q: I’m also not sure why you have the tell application “Applescript Editor” in there.
A: That was my way of jumping back & forth from iTunes, to putting the codes together, to sending out the serial port. Obviously I’m a novice and I appreciate the help!
Which leads to my next pieces of the puzzle, which I think I have “A” semi-figured out, but need help figuring out “B.” Obviously the Comments will hold the codes according to the CD changer it is in, but the other codes in the script will need to be dynamic (i.e. Play command). Thoughts on this?
A. I need to Stop the currently playing CD changer song before sending out the next Play command (Stop Commands: [1A2CE] or [2A2CE] or [3A2CE] or [4A2CE]) – I’m thinking I just send out Stop command to all four CD changers (versus tracking which one the CD is playing on).
B. I have 4 CD changers, with specific CD changer song Play Commands ([1A2CF] or [2A2CF] or [3A2CF] or [4A2CF]), other commands, and of course digit numbers:
Digit Changer 1 Changer 2 Changer 3 Changer 4
0 [1A222] [2A222] [3A222] [4A222]
1 [1A22C] [2A22C] [3A22C] [4A22C]
2 [1A227] [2A227] [3A227] [4A227]
3 [1A22B] [2A22B] [3A22B] [4A22B]
4 [1A221] [2A221] [3A221] [4A221]
5 [1A224] [2A224] [3A224] [4A224]
6 [1A22E] [2A22E] [3A22E] [4A22E]
7 [1A22F] [2A22F] [3A22F] [4A22F]
8 [1A229] [2A229] [3A229] [4A229]
9 [1A22A] [2A22A] [3A22A] [4A22A]