Since macOS Catalina, Reminders.app offers the possibility to fill in an URL in a reminder.
- Click the Info button, then add or change details.
... Irrelevant part of the documentation ...
- Add a URL: Click the URL field, and type a web address.
I am trying, via Automator and with a bit of AppleScript, to create a reminder based upon a text in Chrome.
The goal would be, from a selected text in Chrome, to add a reminder with the URL of the page the selected text is coming from.
I am able to create the reminder properly, along with the name and the body, but I am struggling to fill in the URL field of a reminder.
I tried:
-
which errors with:set url of new_reminder to tab_urlReminders got an error: Can’t set URL of reminder id "x-apple-reminder://AB572176-9661-48FA-ADCF-795D0A912FED" to "https://stackoverflow.com/questions/ask".
-
which errors with:set uri of new_reminder to tab_urlReminders got an error: Can’t make uri of reminder id "x-apple-reminder://2564FAFB-3825-442C-AAD5-BCA17E354D1B" into type specifier.
The first error makes me wonder if the URL should not be type casted into an URL object somehow?
But I am a bit lost on what I should be trying from here.
The macOS version I am on is 10.15.5 (19F101).
Here is my current AppleScript:
on run {input, parameters}
tell application "Google Chrome"
set tab_name to get title of active tab of window 1
set tab_url to get URL of active tab of window 1
tell application "Reminders"
set recipes to list "Recipes"
tell recipes
set new_reminder to make new reminder
set name of new_reminder to tab_name
set body of new_reminder to input
(* set ??? of new_reminder to tab_url *)
end tell
end tell
end tell
end run
