Last active
December 11, 2017 05:36
-
-
Save jweisber/26e1e4cf658804c9e2f957a0c46f3392 to your computer and use it in GitHub Desktop.
Open iTerm from Rstudio: replace /Applications/RStudio.app/Contents/MacOS/mac-terminal (see http://tinyurl.com/jvf6lbx, which is now out of date).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
on run argv | |
set dir to quoted form of (first item of argv) | |
if application "iTerm" is running then | |
set wasRunning to true | |
else | |
set wasRunning to false | |
end if | |
tell application "iTerm" | |
activate | |
if wasRunning then | |
tell current window | |
create tab with default profile | |
end tell | |
end if | |
tell last session of current tab of current window | |
set name to "RStudio Session" | |
write text "cd " & dir & "; clear" | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment