Created
July 10, 2019 00:35
-
-
Save geoffeg/6c44926cbc23c190fd74876aa45c8954 to your computer and use it in GitHub Desktop.
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/bash | |
password=`~/bin/opfzf` | |
iTermSessionId=$1 | |
osascript <<END | |
tell application "iTerm2" | |
repeat with aWindow in windows | |
repeat with aTab in tabs of aWindow | |
repeat with aSession in sessions of aTab | |
set theSessionId to unique id of aSession | |
if theSessionId is "$iTermSessionId" then | |
set targetSession to aSession | |
set targetTab to aTab | |
set targetWindow to aWindow | |
end if | |
end repeat | |
end repeat | |
end repeat | |
tell targetSession | |
write text "$password" | |
end tell | |
end tell | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment