I was really glad to find serialport X as it saves me having to use smile to run some action scripts, but I only seem to be able to run the script once as it can then not access the serial port I assume that is because I have not closed it right. I am still learning applescript to I would appreciate any advice.
set dev to “/dev/cu.usbserial-A9008XQj” – Keyspan USB <-> Serial Port adapter
–set portRef to serialport open dev
set portRef to serialport open dev bps rate 9600 data bits 8 parity 0 stop bits 1 handshake 0
if portRef is equal to -1 then
display dialog " could not open port "
else – send command
set ADcmd to “1*!”
serialport write ADcmd to portRef