Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Replace /Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/iterm.scpt with this.
set itermRunning to (application "iTerm" is running)
set scriptPath to quoted form of POSIX path of ((path to me as text) & "::" & "start.sh")
set user_shell to do shell script "dscl /Search -read /Users/$USER UserShell | awk '{print $2}'"
tell application "iTerm"
activate
if not (exists window 1) or (itermRunning = false) then
reopen
end if
try
tell current window
set newTab to (create tab with default profile)
tell current session of newTab
write text "bash --login " & scriptPath
end tell
end tell
on error
tell current session of (create window with default profile)
write text "bash --login " & scriptPath
end tell
end try
end tell
@crislar

This comment has been minimized.

Copy link

commented Apr 4, 2016

nice - thank you!

@mkowsiak

This comment has been minimized.

Copy link

commented May 29, 2016

Thanks!!!

@cyprusglobe

This comment has been minimized.

Copy link

commented Jun 1, 2016

Thanks!

@apzentral

This comment has been minimized.

Copy link

commented Jun 2, 2016

Thank you, it works perfect!!!

@hyunjun

This comment has been minimized.

Copy link

commented Jun 2, 2016

Thanks!!!

@jnovack

This comment has been minimized.

Copy link

commented Jun 2, 2016

If you have multiple computers, easiest thing to do is to save this file to your iCloud drive and then link from it.

$ sudo mv /Applications/Docker/Docker\ Quickstart\ Terminal.app/Contents/Resources/Scripts/iterm.scpt /Applications/Docker/Docker\ Quickstart\ Terminal.app/Contents/Resources/Scripts/iterm.scpt.bak
$ sudo ln ~/Library/Mobile\ Documents/com~apple~ScriptEditor2/Documents/iterm.scpt /Applications/Docker/Docker\ Quickstart\ Terminal.app/Contents/Resources/Scripts/iterm.scpt
@CYBAI

This comment has been minimized.

Copy link

commented Jun 30, 2016

Thanks!!! It works very well!!!

@chriskirkland

This comment has been minimized.

Copy link

commented Jul 5, 2016

Am I the only one getting this error?
screen shot 2016-07-05 at 9 34 55 am

@defmikekoh

This comment has been minimized.

Copy link

commented Jul 6, 2016

With respect to "Expected end of line", I needed to replace in the .scpt file, "iTerm" with "iTerm2".

@smart-t

This comment has been minimized.

Copy link

commented Jul 28, 2016

Yes master! This is it looking for I was.

@vjdhama

This comment has been minimized.

Copy link

commented Jan 18, 2017

This works. Thanks.

@karstengresch

This comment has been minimized.

Copy link

commented Mar 26, 2018

Cheers, thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.