Last active
November 25, 2019 09:50
-
-
Save Superbil/ca51a676b72570eba2f302861611b326 to your computer and use it in GitHub Desktop.
Read 2FA code from window. source: https://apple.stackexchange.com/questions/336842/get-two-factor-authentication-code-from-terminal
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 characters
#! /usr/bin/env osascript | |
tell application "System Events" | |
if name of every process contains "FollowUpUI" then | |
tell window 1 of process "FollowUpUI" | |
click button "允許" | |
delay 2 | |
set code to value of static text 1 of group 1 | |
log (code) | |
click button "完成" | |
end tell | |
else | |
log ("Couldn't find 2FA window") | |
end if | |
end tell | |
return |
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 characters
#! /usr/bin/env osascript | |
tell application "System Events" | |
if name of every process contains "FollowUpUI" then | |
tell window 1 of process "FollowUpUI" | |
click button "Allow" | |
delay 2 | |
set code to value of static text 1 of group 1 | |
log (code) | |
click button "Done" | |
end tell | |
else | |
log ("Couldn't find 2FA window") | |
end if | |
end tell | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment