2
24th Oct 2021

Picfair iTerm Launcher (AppleScript)

This is a gist containing the AppleScript utility to start the component parts of Picfair simultaneously. It launches ElasticSearch, Redis, Webpack, and Rails grouped together in separate tabs in the same window. Open up the AppleScript editor and save the following gist, naming it startup.scpt


  tell application "iTerm"
	  create window with default profile
	  tell current tab of current window
		  tell current session
			  write text "cd ~/fleetnation"
			  write text "make elastic"
		  end tell
	  end tell
	  tell current window
		  create tab with default profile
		  tell current tab
			  launch session "Default Session"
			  tell the last session
				  write text "cd ~/fleetnation"
				  write text "make redis"
			  end tell
		  end tell
	  end tell
	  tell current window
		  create tab with default profile
		  tell current tab
			  launch session "Default Session"
			  tell the last session
				  write text "cd ~/fleetnation"
				  write text "make webpack"
			  end tell
		  end tell
	  end tell
	  tell current window
		  create tab with default profile
		  tell current tab
			  launch session "Default Session"
			  tell the last session
				  write text "cd ~/fleetnation"
				  write text "make rails"
			  end tell
		  end tell
	  end tell
  end tell
  

This utility can now be run as an alias. Add the following to the systems .zshrc, changing the location of the newly created startup.scpt accordingly.


  pf() {
	osascript ~/Documents/startup.scpt
  }
  
  

Utility in action

1
23rd Oct 2021

Hello World (JavaScript)

This is a hello world entry


    console.log("hello world")