Created
June 30, 2023 19:36
-
-
Save trevor-atlas/45ea4ba63553e81facc93105cf52dc65 to your computer and use it in GitHub Desktop.
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
// Name: vpn | |
// Schedule: */15 * * * * | |
import "@johnlindquist/kit" | |
applescript(` | |
tell application "System Events" to tell process "GlobalProtect" | |
set connectionStatus to get help of every menu bar item of menu bar 2 | |
if item 1 of connectionStatus = "Not Connected" then | |
click menu bar item 1 of menu bar 2 -- Activates the GlobalProtect "window" in the menubar | |
try | |
click button "Connect" of window 1 | |
end try | |
click menu bar item 1 of menu bar 2 -- This will close the GlobalProtect "window" after clicking Connect/Disconnect. This is optional. | |
end if | |
end tell | |
`); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment