Cool AppleScripts for CoolTerm

If you have specific questions or problems with any of my Freeware applications, post them here.
Post Reply
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Cool AppleScripts for CoolTerm

Post 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/
jnmaloof
Posts: 1
Joined: Wed Oct 19, 2016 8:22 am

Re: Cool AppleScripts for CoolTerm

Post 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
v1cph1rth
Posts: 1
Joined: Thu Aug 20, 2020 8:44 am

Re: Cool AppleScripts for CoolTerm

Post 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
wellys
Posts: 11
Joined: Sun Sep 24, 2023 10:04 am

Re: Cool AppleScripts for CoolTerm

Post 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
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Cool AppleScripts for CoolTerm

Post by roger »

Very cool!

Thanks for sharing!

Roger
Post Reply