Last active
June 23, 2022 19:26
-
-
Save aahung/c0be3176c57d656ccf9dbe2bb338dcfd to your computer and use it in GitHub Desktop.
Revisions
-
aahung revised this gist
Nov 2, 2017 . 1 changed file with 3 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 @@ -0,0 +1,3 @@ Make sure you add the app invoking this script is in the Preferences -> Security & Privacy -> Pricavy -> Accessbility For me, I use it with Alfred, so Alfred 3.app is in the list. -
aahung renamed this gist
Nov 2, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
aahung created this gist
Nov 2, 2017 .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,42 @@ tell application "System Events" tell application process "System Preferences" if not (window 1 exists) then tell application "System Preferences" activate end tell repeat while not (menu bar 1 exists) end repeat repeat while not (menu "System Preferences" of menu bar 1 exists) end repeat repeat while not (menu item "Network" of menu "View" of menu bar 1 exists) end repeat end if click menu item "Network" of menu "View" of menu bar 1 tell window 1 repeat while not (rows of table 1 of scroll area 1 exists) end repeat repeat with current_row in (rows of table 1 of scroll area 1) if value of static text 1 of current_row contains "{VPN partial name}" then select current_row exit repeat end if end repeat repeat with current_checkbox in (checkboxes of group 1) if name of current_checkbox is equal to "Connect on demand" then click current_checkbox exit repeat end if end repeat repeat with current_button in buttons if name of current_button is equal to "Apply" then click current_button exit repeat end if end repeat end tell end tell end tell