Page 2 of 2

Re: Command line to open CoolTerm instance connected?

Posted: Sat Nov 08, 2025 3:26 pm
by roger
jmuhammad wrote: Sat Nov 08, 2025 1:53 pm I have to have CoolTerm open first before the 'type: s = CoolTerm.CoolTermSocket()' would connect (i.e. that is what I did after the ERROR message you see below):
Ah, yes, CoolTerm needs to be running before it can accept socket connections.

Re: Command line to open CoolTerm instance connected?

Posted: Sat Nov 08, 2025 3:30 pm
by roger
jmuhammad wrote: Sat Nov 08, 2025 2:51 pm I combined Examples 2,3,12 and got it working. The key is (at least for me) CoolTerm has to be running to connect a socket then load the settings file.

I just need to learn how to further control CoolTerm with the socket. But for this project -- despite the need for hard-coded delays because I don't know when it is ready -- this will do. I have an option to do it all in Python rather than ahk+python.
Great! I'm glad you got it working!

The learning curve for this shouldn't be too bad. You'll find that you can do almost anything with scripting that you can do via the CoolTerm GUI. Please post back to the forum if you have any further questions.

Roger

Re: Command line to open CoolTerm instance connected?

Posted: Sun Nov 09, 2025 10:11 pm
by jmuhammad
FYI, in CoolTerm.py:
SerialPortName(SerialPortIndex as integer) as string: Returns the name of the serial port with the specified index.
should be:
GetSerialPortName(SerialPortIndex as integer) as string: Returns the name of the serial port with the specified index.

Re: Command line to open CoolTerm instance connected?

Posted: Mon Nov 10, 2025 12:53 pm
by roger
Thanks for the heads up.

SerialPortName() is actually the name used internally and with AppleScript. The documentation is correct. I will add the SerialPortName() call to CoolTerm.py in addition to GetSerialPortName() in order to not break any scripts anybody has written. Both will work and do the same.
The same applies to SerialPortCount() and GetSerialPortCount(). The next CoolTerm release will include the updated CoolTerm.py module.

Meanwhile, I have attached the updated CoolTerm.py (remove the .txt extension):
CoolTerm.py.txt