-- Projector Control Script -- Reset Commands set PortSelect to "" set ProjCommand to "" set result to "" -- Set Serial Port IDs set SerPort1 to "cu.SXProS3P1.1" set SerPort2 to "cu.SXProS3P2.2" set SerPort3 to "cu.SXProS3P3.3" set SerPort4 to "cu.SXProS3P4.4" set SerPort5 to "cu.USA19QW212P1.1" -- Set Projector IDs set Frt_Proj1 to SerPort1 set Frt_Proj2 to SerPort2 set Frt_Proj3 to SerPort3 set RR_Proj to SerPort4 -- Set Ascii (Hex) Codes set H00 to ASCII character (0) set H01 to ASCII character (1) set H02 to ASCII character (2) set H03 to ASCII character (3) set H04 to ASCII character (4) set H05 to ASCII character (5) set H06 to ASCII character (6) set H07 to ASCII character (7) set H08 to ASCII character (8) set H09 to ASCII character (9) set H0A to ASCII character (10) set H0B to ASCII character (11) set H0C to ASCII character (12) set H0D to ASCII character (13) set H0E to ASCII character (14) set H0F to ASCII character (15) set H10 to ASCII character (16) set H11 to ASCII character (17) set H12 to ASCII character (18) set H13 to ASCII character (19) set H14 to ASCII character (20) set H15 to ASCII character (21) -- Set Epson Projector Command Sequences set Proj_On to H02 & H00 & H00 & H00 & H00 & H02 set Proj_Off to H02 & H01 & H00 & H00 & H00 & H03 set Proj_RGB to H02 & H03 & H00 & H00 & H02 & H01 & H01 & H09 set Proj_CVid to H02 & H03 & H00 & H00 & H02 & H01 & H06 & H0E set Proj_SVid to H02 & H03 & H00 & H00 & H02 & H01 & H0B & H13 set Proj_VMuteOn to H02 & H10 & H00 & H00 & H00 & H12 set Proj_VMuteOff to H02 & H11 & H00 & H00 & H00 & H13 -- Make Selections choose from list {"Proj1", "Proj2", "Proj3", "RR_Proj", "SerPort5"} with prompt "Select Projector" multiple selections allowed "true" set Proj to result as text if Proj is "Proj1" then set PortSelect to Frt_Proj1 else if Proj is "Proj2" then set PortSelect to Frt_Proj2 else if Proj is "Proj3" then set PortSelect to Frt_Proj3 else if Proj is "RR_Proj" then set PortSelect to RR_Proj end if end if end if end if set result to "" choose from list {"On", "Off", "RGB", "CompVid", "SVid", "VMuteOn", "VMuteOff"} with prompt "Select Command" set Command to result as text if Command is "On" then set ProjCommand to Proj_On else if Command is "Off" then set ProjCommand to Proj_Off else if Command is "RGB" then set ProjCommand to Proj_RGB else if Command is "CompVid" then set ProjCommand to Proj_CVid else if Command is "SVid" then set ProjCommand to Proj_SVid else if Command is "VMuteOn" then set ProjCommand to Proj_VMuteOn else if Command is "VMuteOff" then set ProjCommand to Proj_VMuteOff end if end if end if end if end if end if end if -- Double Check display dialog Proj & " " & Command if button returned of result is "OK" then -- Write Command Sequence tell application "PortTerm" activate connect to port PortSelect configure baud rate "19200" parity "none" write data ProjCommand disconnect end tell end if