https://github.com/supermitch/iterm-scripts
iTerm Applescripting automation is really fun, and really powerful. And not easy.
https://github.com/supermitch/iterm-scripts
applescript automation iterm iterm2 scripting
Last synced: 2 days ago
JSON representation
iTerm Applescripting automation is really fun, and really powerful. And not easy.
- Host: GitHub
- URL: https://github.com/supermitch/iterm-scripts
- Owner: supermitch
- License: unlicense
- Created: 2018-04-18T18:00:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-02T00:51:25.000Z (over 7 years ago)
- Last Synced: 2025-03-25T05:41:49.043Z (6 months ago)
- Topics: applescript, automation, iterm, iterm2, scripting
- Language: AppleScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
iTerm Scripts
=============🍏 iTerm
[Applescripting](https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptX/AppleScriptX.html)
automation is fun.## Compiling Applescript
Plaintext `.applescript` files should be compiled into binary `.scpt` files to use them happily.
My preference is just to write them in Apple's Script Editor, and compile & export as a script.
If you insist on using your own editor, compile via `osacompile -o filename.scpt filename.applescript`.
## Script Libraries
To create importable _libraries_, put them in: `~/Library/Script Libraries/`
* You may have to create that folder
* These files _must_ be compiled `.scpt` format## iTerm2 Scripts
Put `.scpt` scripts in: `~/Library/Application Support/iTerm2/Scripts/`
When you restart iTerm2 you should now see a *Scripts* menu option.
Go nuts!
## Bash Aliases
Simply put something like the following into your `.bashrc` or `.zshrc`:
```bash
alias six="osascript ~/Libary/Application Support/iTerm2/Scripts/six_sessions.scpt "
```With aliases, you can pass args to your scripts, e.g. `six 101`.
See [this example script](six_sessions/six_sessions.applescript) for more info.