Skip to content

Instantly share code, notes, and snippets.

@caseyscarborough
Last active October 4, 2021 11:12
Show Gist options
  • Save caseyscarborough/6192974 to your computer and use it in GitHub Desktop.
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.
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