Last active
November 18, 2017 07:56
-
-
Save zunda/8be964b3fe6da27acc26e33af9ceb702 to your computer and use it in GitHub Desktop.
macOS 10.12.6でiTerm2を起動するApple Script
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
on run {input, parameters} | |
tell application "iTerm" | |
create window with default profile | |
activate | |
end tell | |
return input | |
end run |
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
on run {input, parameters} | |
tell application "iTerm" | |
create window with default profile command "/path/to/vim-scratch.sh" | |
activate | |
end tell | |
return input | |
end run |
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
#!/bin/sh | |
path=/tmp/scratch.`date +%H%M%S`.txt | |
pbpaste > $path | |
/usr/bin/vim -c 'set enc=utf8 fenc=utf8' $path | |
cat $path | pbcopy | |
sleep 0.5 |
Author
zunda
commented
Nov 18, 2017
- iTerm2のドキュメント https://www.iterm2.com/documentation-scripting.html
- Automatorを起動してFile - NewからServiceをChoose、Service receives selected: no inputにして、左のUtilities - Run AppleScriptで上記をコピペ、Saveで適当な名前をつける
- System Preferences...、Keyboard - Shortcuts - Services - 下の方のGeneralに現れるのでショートカットキーを設定する
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment