Amazing! Brilliant! Thank you so much! Yeeppee!
For those who need to know (I didn't previously), you can add a script to the top menu bar with this: https://support.apple.com/guide/script-editor/access-scripts-using-the-script-menu-scpedt27975/
[EDIT] If any of you know of a more elegant / convenient way of installing & triggering the script, could you share?
I kinda improved your script to better suit my needs on 2 aspects:
- When selecting several photos in Photos, they will all be set to the same location (therefore asking for lat,long only once), matching the behaviour of the Information pane that we've known.
- Actually display an alert when there is no photo selected (required a try/catch when using the Scripts menu).
tell application "Photos"
try
set selectedImages to (get selection)
if selectedImages is {} then
error "Please select an image."
end if
set response to display dialog "New location:" default answer "" buttons {"Cancel", "OK"} default button "OK" with icon note
set newLocationString to text returned of response
if ((button returned of response) = "OK") and (newLocationString is not "") then
set AppleScript's text item delimiters to ","
set theLocList to every text item of newLocationString
repeat with theImage in selectedImages
set the location of theImage to theLocList
end repeat
display alert "New location set to: " & newLocationString
end if
on error errorMsg number errorNumber
display alert errorMsg buttons {"OK"}
end try
end tell