Use AppleScript to automate tasks


(Yang.Y) #1

The Premium version of Core Shell and Core Tunnel have AppleScript support, you can automate tasks and improve productivity with only a teaspoonful of programming knowledge.

The AppleScript dictionary contains the available AppleScript commands for Core Shell and Core Tunnel. To view the dictionary:

  1. Open the AppleScript Editor in Applications > Utilities.
  2. Choose File > Open Dictionary.
  3. Select Core Shell or Core Tunnel. Click Choose.


Core Shell

Version 1.6.2 or later is required.

tell application "Core Shell"
	set mysterWin to open shell on "A Mysterious Host" with in new tab
	tell mysterWin
		get history of its terminal
		repeat until result contains "Connected"
			delay 1
			get history of its terminal
		end repeat
		do script "ls" in mysterWin
	end tell
	-- close mysterWin
end tell

Core Tunnel

Version 1.6 or later is required.

tell application "Core Tunnel"
	script Helper
		on waitUnitlConnected(theTunnel)
			get state of theTunnel
			repeat until result = "Connected"
				delay 1
				get state of theTunnel
			end repeat
		end waitUnitlConnected
	end script
	set mysterTunnel to a reference to (first tunnel where name = "A Mysterious Tunnel")
	connect mysterTunnel
	tell Helper to waitUnitlConnected(mysterTunnel)
	-- disconnect mysterTunnel
	-- connect "A Mysterious Tunnel"
	-- disconnect "A Mysterious Tunnel"
	-- connect with tag "tag_name"
	-- disconnect with tag "tag_name"
	-- connect all
	-- disconnect all
end tell

FAQ – Core Tunnel
FAQ – Core Shell
Apple Script Info