Hey, I’m Walkin’ Here!
I was recently in New York City and that meant I was juggling Google Maps and Apple Maps to get around. They’re largely comparable products these days, but there are some strengths and weaknesses that make it worth my time to juggle them. I created a Shortcut to help with that.
Google Maps is where my boyfriend and I go to check location information, and to collaboratively edit the Google Maps List of places we plan on visiting. I have talked about this extensively in my travel posts. Apple has walking direction previews for the Apple Watch so you can keep your phone in your pocket while you walk around the gray slush of New York City in the winter.
There I was, entering the long name of a place in Apple Maps that I had just entered in Google Maps, with my capacitive-friendly gloves that don’t work well for small tap targets, and it occurred to me that there had to be some way to automate this. That meant my old nemesis, Shortcuts.
Google Maps doesn’t immediately expose a traditional Share Sheet when you share a location. In the upper right corner of the location information is the sharrow which brings up a modal preview card for the location, and three buttons to share this place, copy link, or share as a collaborative list. Sharing this place finally brings up the Share Sheet.
What the app shares is a shortened URL, like this one:
https://maps.app.goo.gl/8YUvDPbQPrasqC528?g_st=ic
Fortunately, Shortcuts has a URL expander. The expansion of that example URL gives us this:
https://www.google.com/maps?q=Aux+Merveilleux+de+Fred,+37+8th+Ave,+New+York,+NY+10014&ftid=0x89c259957da502cd:0xed3eb58a4ca08a95&entry=gps&lucs=,94255440,94242598,94224825,94227247,94227248,94231188,47071704,47069508,94218641,94203019,47084304,94208458,94208447&g_ep=CAISEjI1LjA1LjMuNzIwMTgwNTk0MBgAIJ6dCip1LDk0MjU1NDQwLDk0MjQyNTk4LDk0MjI0ODI1LDk0MjI3MjQ3LDk0MjI3MjQ4LDk0MjMxMTg4LDQ3MDcxNzA0LDQ3MDY5NTA4LDk0MjE4NjQxLDk0MjAzMDE5LDQ3MDg0MzA0LDk0MjA4NDU4LDk0MjA4NDQ3QgJVUw%3D%3D&g_st=com.apple.shortcuts.Run-Workflow.(null)
What an ugly, but extremely useful URL. The name of the location is in the URL with +
in the place of whitespace. Unfortunately, this meant I needed to use regex, and even worse still, use regex in Shortcuts, which for some reason requires two steps: Match Text (for the regex), and Get Group From Matched Text (because Match Text returns a list, even if it’s only one item).
The one thing LLM’s are good for is writing regex. I asked one to write me some of The Devil’s Language, and I got (?<=q=)([^&]+)
. I do a simple replace on +
to and I have a totally normal location string.
Aux Merveilleux de Fred, 37 8th Ave, New York, NY
This is fed to the the Open in Maps Shortcut block. I have it set to walking directions because that it is my use case, and I wanted to reduce prompts, but it could just as easily ask the user. All I have to do is tap those share buttons, the shortcut, hit “Go” when Apple Maps appears, and then I’m off to the races. No typing things over again.
The shortcut works great, although there’s no easy way to only surface the Shortcut only when the Google Maps Share Sheet is up. Because it’s a URL, any other sharing function that uses a URL will display this. I did build an if statement to make sure the input is the expected URL format, but that’s not the same thing as only showing the button when it’s applicable to do so.
It was a little disappointing that I built this on the very last day I was in New York, but I’ll have it ready for the next time I travel, and you can too.
Category: text