I wrote a little AppleScript to:
-Scan the Serial Ports
-Connect to each serial port and perform a task
-Repeat for full list of Serial Ports
Took me a bit of fiddling, but figured it out and wanted to share. If you want it to just continuously run, you could put another Repeat loop around it. For example, I am using this to talk to a bunch of different microcontrollers over a USB Hub and check the status.
- Code: Select all
tell application "CoolTerm"
set w to LoadSetting stcLocation.stc #my directory path is inserted here normally
RescanSerialPorts
set portCount to (SerialPortCount)
set currentPort to GetCurrentSerialPort (w)
repeat with n from 0 to portCount
Disconnect (w)
SetCurrentSerialPort {w, (portCount - n)}
set currentPort to GetCurrentSerialPort (w)
Connect (w)
#Operational code for my intended use
end repeat
end tell