Page 1 of 1

Cool AppleScripts for CoolTerm

Posted: 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

Posted: 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

Posted: 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

Re: Cool AppleScripts for CoolTerm

Posted: Tue Sep 26, 2023 8:24 am
by wellys
I use Sublime Text (ST) for writing MicroPython programs. ST has a build system which allows you to write simple scripts to automate the steps required to create an application. In the case of MicroPython, the steps are:
1. Disconnect CoolTerm
1. Upload file(s)
1. Connect CoolTerm

The Applescript capability of CoolTerm makes this a game-changer, in that it allows the automation to have some intelligence to determine if CoolTerm is running and if it's connection state.

I have a write up here: https://github.com/lkoepsel/mpython_Automation

Re: Cool AppleScripts for CoolTerm

Posted: Tue Sep 26, 2023 2:24 pm
by roger
Very cool!

Thanks for sharing!

Roger