-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from jeremybahadirli/consolidate-terminal-scripts
Consolidate terminal scripts
- Loading branch information
Showing
4 changed files
with
32 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
on run {input} | ||
set terminal to "Terminal" # "Terminal" or "iTerm" | ||
set cmd to "vim" | ||
|
||
repeat with eachItem in input | ||
set cmd to cmd & " " & quoted form of POSIX path of eachItem | ||
end repeat | ||
|
||
if terminal is "Terminal" then | ||
tell application "Terminal" | ||
launch | ||
do script cmd | ||
activate | ||
end tell | ||
else if terminal is "iTerm" then | ||
tell application "iTerm" | ||
launch | ||
create window with default profile | ||
tell current session of current window to write text cmd | ||
activate | ||
end tell | ||
end if | ||
end run |