Make Event in Calendar with AppleScript with Location that's recognised

When manually creating a new event in Calendar, entering a (recognised) address/location shows a small map with a pin in the info sheet. However, entering precisely the same address data when making an event with AppleScript does not make the geographical association - so functionality like "Alert when I need to leave" does not work.


Does anyone know how to get the association to happen when making an event with AppleScript please? (I'm not against the possibility of running a second script over a calendar if this is an option.)

Mac Studio, macOS 13.2

Posted on Feb 24, 2023 11:57 AM

Reply
3 replies

Feb 24, 2023 3:48 PM in response to Arkouda

I took a quick look at this, and couldn't find an answer you'd like.


As far as AppleScript is concerned, there is no functional difference between a manually-created event whose location shows the map, and a auto-created event where a script sets the location.


The trigger seems to be on the event's Location feed, where it auto-suggests locations as you type. There doesn't appear to be a way to replicate the functionality via a script, other than via UI scripting (which emulates user actions), but I wouldn't even try to craft that one (it's bad enough using UI scripting on fixed windows, but in popups? that's asking for trouble.

Feb 25, 2023 5:26 AM in response to Arkouda

I didn't have any luck with coordinates. I found something in Shortcuts that works by setting a Location first and then using that variable in a subsequent action that makes the new Event, but I can't find any equivalent in AppleScript.


I'm going to try using Shortcuts to iterate over the events made by my AppleScript - to extract the location from the event, set the Location var to it, then update the event location with the var. Then again, I might just put up with having a textual location!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Make Event in Calendar with AppleScript with Location that's recognised

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.