Page 1 of 1

Cool AppleScripts for CoolTerm

PostPosted: Fri Nov 09, 2012 2:19 am
by roger
This is a thread where everybody is invited to share AppleScripts they've written for CoolTerm.

I'll start with a blog post I've come across this year. It was written by Ashley Hughes and discusses using AppleScript with CoolTerm for datalogging.

http://ashleyhughesarduino.wordpress.co ... escript-2/

Re: Cool AppleScripts for CoolTerm

PostPosted: Mon Oct 31, 2016 7:32 am
by jnmaloof
I have modified Roger's original script to enable input into excel and into google chrome. I also changed the way that the loop was done so that the applescript could be compiled into a clickable program. These are available at https://github.com/MaloofLab/PlantMeasurement

Re: Cool AppleScripts for CoolTerm

PostPosted: Thu Aug 20, 2020 9:01 am
by v1cph1rth
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