Macro: Set Default Printer Based on Location

I created this macro to allows my laptop to automatically assign a default printer based on my location. This helps when I travel between multiple offices.

I used ControlPlane app previously, but it has not been supported for years and has not been working well. Also, ControlPlane uses a lot of memory and power as it is running.

This macro, requires the Location (a freebie from the app-store).

and the Keyboard Maestro plug-in Split Text - Plugin Action.

To find your location, use Google Maps or run the following script separately in the apple script editor:

tell application "Location Helper"
   set a_coords to get location coordinates
end tell

return a_coords

Round the coordinate results (I used 4 digits after the "."), this way if you move around the building/large office, your location does not change. You can make your location more precise by adjusting format from 0.00.

You should also replace printer names with the ones installed on your mac.

Instead of printers, one can use this approaches to connect to a different wifi, or do many other action needed based on location. I am certain that more knowledgeable folks can simplify/improve this macro further.



1 Like