Last active
April 7, 2023 14:08
-
-
Save kkew3/3802f198e8bbd82c40e456bbd1400daf to your computer and use it in GitHub Desktop.
Revisions
-
kkew3 revised this gist
Apr 7, 2023 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,5 +24,7 @@ on alfred_script(q) set theAlfredSession to current session of newWindow end if tell theAlfredSession to write text q # or add a space before `q` to prevent it from going into history: #tell theAlfredSession to write text (space & q) end tell end alfred_script -
kkew3 created this gist
Apr 7, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ # Paste this script to "Alfred Preference > Advanced > Terminal", # selecting "Application" to "Custom". # # In addition, create an iTerm2 profile with string "Alfred" in its Name, # for example, "Working with Alfred". # # The script below will open the first iTerm2 session with such profile, # or create a new window with that profile if not found. The command # will be executed there. on alfred_script(q) tell application "iTerm" set theAlfredSession to null repeat with aWindow in windows tell aWindow if (profile name of current session) contains "Alfred" then set theAlfredSession to (current session) exit repeat end if end tell end repeat if theAlfredSession is null then set newWindow to (create window with profile "Working with Alfred") set theAlfredSession to current session of newWindow end if tell theAlfredSession to write text q end tell end alfred_script