![]() There are many standard Applescript functions (e.g., to get the window's size and position) that are not documented here.Ĭreate tab with default profile command " command"Ĭreate tab with profile " name" command " command"Ĭreates a tab with the default profile or a profile by name. These functions and properties are provided by windows. The following are standard Applescript idioms for accessing elements of an array of objects: tell first window ![]() Other windows, like the preferences panel, are not included. Set newWindow to (create window with profile "Name Of Some Profile" command "ls -l -R /")Ī reference to the window that most recently had keyboard focus.Ī windows property exposes an array of terminal windows. Set newWindow to (create window with profile "Name Of Some Profile") If you specify a command, it overrides the profile's command (which by default is to invoke `login`). These commands create a window with a named profile. Set newWindow to (create window with default profile command "ls -l -R /")Ĭreate window with profile " name" command " command" Set newWindow to (create window with default profile) These commands create a window with the default profile. The profile must be configured to have a hotkey.Ĭreate hotkey window with profile "Hotkey Window"Ĭreate window with default profile command " command" For example: tell application "iTerm2"Ĭreate hotkey window with profile " name"Ĭreates a hotkey window with the specified profile. The application exposes various properties and provides functions that are described in this section. Multiple sessions in a tab happen when there are split panes. The application has zero or more windows, each window has one or more tabs, and each tab has one or more sessions. The basic objects are: window, tab, and session. Scripts must be named with the extension. You can create this directory if it does not already exist. The scripts need to be stored under the ~/Library/Application Support/iTerm/Scripts directory. ITerm2 also supports launching of user defined scripts from the "Scripts" menu. If that folder does not exist, the legacy path of "~/Library/Application Support/iTerm/Scripts/AutoLaunch.scpt" will be used. If it is found, the "AutoLaunch.scpt" script is launched and executed. On startup, iTerm2 looks for an Applescript file in "~/Library/Application Support/iTerm2/Scripts/AutoLaunch.scpt". ITerm2 also supports autolaunching of an Applescript on startup. These scripts can then be saved as stand-alone executable applications. You can also set some other parameters for a session such as foreground and background colors, and transparency. ITerm2 has sophisticated Applescript support allowing one to write stand-alone scripts to launch the application and open multiple sessions with profiles into either new tabs or new windows. Quite a bit of customization is also possible by writing shell scripts. ITerm2 features Applescript support which allows you to automate many aspects of its behavior. WARNING: This document is for an older version of iTerm2.
0 Comments
Leave a Reply. |