Last active
October 4, 2021 11:12
-
-
Save caseyscarborough/6192974 to your computer and use it in GitHub Desktop.
This is an AppleScript that is used to change your network location. It can be assigned to a shortcut using Automator.
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
try | |
set network_location to do shell script ("scselect | awk '{if ($1==\"*\") print $3}' | sed 's/[()]//g'") | |
on error | |
display dialog "There was an error with the script." | |
end try | |
if network_location is "LocationA" then | |
do shell script "scselect LocationB" | |
else if network_location is "LocationB" then | |
do shell script "scselect LocationA" | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment