AppleScript for WezTerm Alfred integration. Inspired by Vitorgalvao's script for iTerm.
- Copy the script to your clipboard (see below).
- Open Alfred Preferences (call Alfred and press ⌘,).
- Navigate to Features → Terminal → Custom.
- Set Application to Custom.
- Select the text in the box.
- Paste the script.
- Launch Alfred.
- Start with a
>
and type your command. - Press Enter.
- It will open WezTerm and execute your command in a new tab.
on alfred_script(query)
tell application "wezterm" to activate
set paneId to do shell script "/Applications/WezTerm.app/Contents/MacOS/wezterm cli spawn"
set commandList to paragraphs of query
repeat with command in commandList
do shell script "echo " & command & " | /Applications/WezTerm.app/Contents/MacOS/wezterm cli send-text --no-paste --pane-id " & paneId
end repeat
end alfred_script