Created
March 20, 2020 01:01
-
-
Save nhtzr/cb2399bdf9bca3f6f88dce01b4c877a1 to your computer and use it in GitHub Desktop.
askpass for osx
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
#!/usr/bin/env sh | |
osascript -e " | |
on GetCurrentApp() | |
tell application \"System Events\" | |
set _app to item 1 of (every process whose frontmost is true) | |
return name of _app | |
end tell | |
end GetCurrentApp | |
set _app to GetCurrentApp() | |
tell application _app | |
text returned of (display dialog \"Please enter your password:\" ¬ | |
with title \"Password\" ¬ | |
with icon caution ¬ | |
default answer \"\" ¬ | |
buttons {\"Cancel\", \"OK\"} default button 2 ¬ | |
giving up after 295 ¬ | |
with hidden answer) | |
end tell | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment