text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
on getConnected()
|
DUO ANYCONNECT NEW.scpt
|
click button "Connect" of ACWindow
|
DUO ANYCONNECT NEW.scpt
|
repeat while (windows of AppProc whose title is "Cisco AnyConnect Login") is {}
|
DUO ANYCONNECT NEW.scpt
|
set DuoWindow to item 1 of (windows of AppProc whose title is "Cisco AnyConnect Login")
|
DUO ANYCONNECT NEW.scpt
|
perform action "AXRaise" of DuoWindow
|
DUO ANYCONNECT NEW.scpt
|
set DuoHTMLArea to {}
|
DUO ANYCONNECT NEW.scpt
|
repeat while DuoHTMLArea is {}
|
DUO ANYCONNECT NEW.scpt
|
set DuoHTMLArea to my RecurseUIForElem(DuoWindow, "AXWebArea", "Cisco.com Login Page")
|
DUO ANYCONNECT NEW.scpt
|
set UserName to system attribute "USER"
|
DUO ANYCONNECT NEW.scpt
|
set UserName to UserName & "@cisco.com"
|
DUO ANYCONNECT NEW.scpt
|
set UserNameTextField to {}
|
DUO ANYCONNECT NEW.scpt
|
set PasswordTextField to {}
|
DUO ANYCONNECT NEW.scpt
|
repeat while PasswordTextField is {}
|
DUO ANYCONNECT NEW.scpt
|
repeat while UserNameTextField is {}
|
DUO ANYCONNECT NEW.scpt
|
set UserNameTextField to my RecurseUIForAttribute(DuoHTMLArea, "AXPlaceholderValue", "email")
|
DUO ANYCONNECT NEW.scpt
|
set PasswordTextField to my RecurseUIForAttribute(DuoHTMLArea, "AXPlaceholderValue", "Password")
|
DUO ANYCONNECT NEW.scpt
|
set value of UserNameTextField to UserName
|
DUO ANYCONNECT NEW.scpt
|
set value of PasswordTextField to userToken
|
DUO ANYCONNECT NEW.scpt
|
set Popup to {}
|
DUO ANYCONNECT NEW.scpt
|
repeat while Popup is {}
|
DUO ANYCONNECT NEW.scpt
|
set Popup to my RecurseUIForElem(DuoHTMLArea, "AXPopUpButton", "Device")
|
DUO ANYCONNECT NEW.scpt
|
set dialogResult to display dialog "Touch Yubikey now..." default answer "" buttons {"OK"} default button "OK" with title "Get YubiKey-OTP -> " & name of me
|
DUO ANYCONNECT NEW.scpt
|
repeat until length of text returned of dialogResult is 44
|
DUO ANYCONNECT NEW.scpt
|
set dialogResult to display dialog "Invalid Yubikey token" & return & "Quit or Retry touching Yubikey now..." default answer "" buttons {"Retry", "Quit"} with title name of me
|
DUO ANYCONNECT NEW.scpt
|
if button returned of dialogResult is "Quit" then
|
DUO ANYCONNECT NEW.scpt
|
set DuoCloseButton to my RecurseUIForElem(DuoWindow, "AXButton", "close button")
|
DUO ANYCONNECT NEW.scpt
|
click DuoCloseButton
|
DUO ANYCONNECT NEW.scpt
|
error "User canceled." number -128
|
DUO ANYCONNECT NEW.scpt
|
display notification "User Cancelled" with title "Duo AnyConnect"
|
DUO ANYCONNECT NEW.scpt
|
click Popup
|
DUO ANYCONNECT NEW.scpt
|
click menu item "Token" of menu 1 of group 1 of DuoWindow
|
DUO ANYCONNECT NEW.scpt
|
set PasscodeButton to my RecurseUIForElem(DuoHTMLArea, "AXButton", "Enter a Passcode")
|
DUO ANYCONNECT NEW.scpt
|
click PasscodeButton
|
DUO ANYCONNECT NEW.scpt
|
set TokenField to {}
|
DUO ANYCONNECT NEW.scpt
|
repeat while TokenField is {}
|
DUO ANYCONNECT NEW.scpt
|
set TokenField to my RecurseUIForAttribute(DuoHTMLArea, "AXPlaceholderValue", "(ex. 867539)")
|
DUO ANYCONNECT NEW.scpt
|
set value of TokenField to text returned of dialogResult
|
DUO ANYCONNECT NEW.scpt
|
set UIGrandParent to my GetUIAncestor(TokenField, 2)
|
DUO ANYCONNECT NEW.scpt
|
set LoginButton to {}
|
DUO ANYCONNECT NEW.scpt
|
repeat while LoginButton is {}
|
DUO ANYCONNECT NEW.scpt
|
set LoginButton to my RecurseUIForElem(UIGrandParent, "AXButton", "Log In")
|
DUO ANYCONNECT NEW.scpt
|
click LoginButton
|
DUO ANYCONNECT NEW.scpt
|
repeat while (windows of AppProc whose title is "Cisco AnyConnect - Banner") is {}
|
DUO ANYCONNECT NEW.scpt
|
click button "Accept" of window "Cisco AnyConnect - Banner" of AppProc
|
DUO ANYCONNECT NEW.scpt
|
display notification "VPN Connected" with title "Duo AnyConnect"
|
DUO ANYCONNECT NEW.scpt
|
end getConnected
|
DUO ANYCONNECT NEW.scpt
|
on my_Prefs(action, theKeyValue)
|
DUO ANYCONNECT NEW.scpt
|
if action is "set" and theKeyValue is "yes" then
|
DUO ANYCONNECT NEW.scpt
|
do shell script "defaults write com.cisco." & prefsName & " saved" & " '" & theKeyValue & "'"
|
DUO ANYCONNECT NEW.scpt
|
do shell script "security add-generic-password -a " & prefsName & " -w " & quoted form of myPassword & " -j 'Used by Applescript Deskpro Volume' -s" & prefsName
|
DUO ANYCONNECT NEW.scpt
|
else if action is "set" and theKeyValue is "no" then
|
DUO ANYCONNECT NEW.scpt
|
else if action is "set" and theKeyValue is "autoOk" then
|
DUO ANYCONNECT NEW.scpt
|
do shell script "defaults write com.cisco." & prefsName & " legalwarning" & " ' 1'"
|
DUO ANYCONNECT NEW.scpt
|
else if action is "reset" and theKeyValue is "clear" then
|
DUO ANYCONNECT NEW.scpt
|
do shell script "defaults delete com.cisco." & prefsName & " saved"
|
DUO ANYCONNECT NEW.scpt
|
do shell script "defaults delete com.cisco." & prefsName & " legalwarning"
|
DUO ANYCONNECT NEW.scpt
|
do shell script "security delete-generic-password -a " & prefsName
|
DUO ANYCONNECT NEW.scpt
|
else if action is "reset" and theKeyValue is "resetpwd" then
|
DUO ANYCONNECT NEW.scpt
|
end my_Prefs
|
DUO ANYCONNECT NEW.scpt
|
set myname to name of current application
|
DUO ANYCONNECT NEW.scpt
|
if myname is "osascript" then
|
DUO ANYCONNECT NEW.scpt
|
set myname to "Script Menu"
|
DUO ANYCONNECT NEW.scpt
|
tell application "System Events" to set isUIScriptingEnabled to UI elements enabled
|
DUO ANYCONNECT NEW.scpt
|
if isUIScriptingEnabled = false then
|
DUO ANYCONNECT NEW.scpt
|
display notification "Please follow instructions when they appear" with title (name of me) as text subtitle "Loading Security & Privacy Preferences..."
|
DUO ANYCONNECT NEW.scpt
|
set current pane to pane "com.apple.preference.security"
|
DUO ANYCONNECT NEW.scpt
|
tell current pane to reveal anchor "Privacy_Accessibility"
|
DUO ANYCONNECT NEW.scpt
|
display dialog "Your system needs a one-time configuration to run this script." & return & return & "In \"System Preferences... -> Security & Privacy -> Privacy\":" & return & return & "1. Unlock \"Click the lock to make changes\"" & return & "2. Select \"Click Accessibility\"" & return & "3. Select checkbox next to: \"" & myname & "\"" & return & "4. Re-run the script to proceed." with title name of me buttons {"OK"} cancel button "OK" with icon note
|
DUO ANYCONNECT NEW.scpt
|
do shell script "system_profiler SPUSBDataType 2>/dev/null | grep -i 'YubiKey.*OTP'"
|
DUO ANYCONNECT NEW.scpt
|
if the errorNumber is equal to 1 then
|
DUO ANYCONNECT NEW.scpt
|
set dialogResult to display dialog "Yubikey OTP device not detected please connect manually" buttons {"Reset Password", "Clear Settings", "Quit"} default button "Quit" cancel button "Quit" with title name of me giving up after 3
|
DUO ANYCONNECT NEW.scpt
|
if button returned of dialogResult is "Clear Settings" then
|
DUO ANYCONNECT NEW.scpt
|
do shell script "defaults delete com.cisco." & prefsName
|
DUO ANYCONNECT NEW.scpt
|
else if button returned of dialogResult is "Reset Password" then
|
DUO ANYCONNECT NEW.scpt
|
set autoOk to do shell script "defaults read " & quoted form of prefName & " " & quoted form of autoOkPropName
|
DUO ANYCONNECT NEW.scpt
|
legalWarning()
|
DUO ANYCONNECT NEW.scpt
|
checkConnection()
|
DUO ANYCONNECT NEW.scpt
|
set userToken to KeyChainer("get")
|
DUO ANYCONNECT NEW.scpt
|
getConnected()
|
DUO ANYCONNECT NEW.scpt
|
set desiredPosition to {0.2, 0.0}
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set desiredSize to {0.8, 1.0}
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
tell application "Finder" to set screenSize to bounds of window of desktop
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set screenWidth to item 3 of screenSize
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set screenHeight to item 4 of screenSize
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set finalPositionX to (item 1 of desiredPosition) * screenWidth
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set finalPositionY to (item 2 of desiredPosition) * screenHeight
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set finalPosition to {finalPositionX, finalPositionY}
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set finalSizeX to (item 1 of desiredSize) * screenWidth
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set finalSizeY to (item 2 of desiredSize) * screenHeight
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set finalSize to {finalSizeX, finalSizeY}
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
set theBounds to {finalPosition} & {finalSize}
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
tell front window of (first application process whose frontmost is true) to set {position, size} to theBounds
|
18 - β¬οΈπ¨π¨π¨π¨ β¦ Right 4|5.scpt
|
tell application "Spillo"
|
Write Selected Bookmarks to Clipboard.applescript
|
set content_string to ""
|
Write Selected Bookmarks to Clipboard.applescript
|
set selected_bookmarks to selected bookmarks
|
Write Selected Bookmarks to Clipboard.applescript
|
repeat with current_bookmark in selected_bookmarks
|
Write Selected Bookmarks to Clipboard.applescript
|
set bookmark_title to title of current_bookmark
|
Write Selected Bookmarks to Clipboard.applescript
|
if bookmark_title is not "" then
|
Write Selected Bookmarks to Clipboard.applescript
|
set content_string to content_string & bookmark_title & return
|
Write Selected Bookmarks to Clipboard.applescript
|
set bookmark_url to url of current_bookmark
|
Write Selected Bookmarks to Clipboard.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.