Skip to content

Instantly share code, notes, and snippets.

@Zettt
Created June 23, 2013 10:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zettt/5844568 to your computer and use it in GitHub Desktop.
Save Zettt/5844568 to your computer and use it in GitHub Desktop.
Script to put a list of text from your clipboard in Reminders. Inspiration drawn from Drafts' "List to Reminders" feature. More info: (not published yet)
-- get clipboard and separate lines
set clipboardText to the clipboard as text
set reminderLines to paragraphs of clipboardText
set defaultRemindersList to "Shoppinglist"
-- figure out if a non-default reminder list should be used
if item 1 of reminderLines starts with "!" then
-- set other reminder list and delete first line
set remindersList to characters 2 thru -1 of item 1 of reminderLines as text
set reminderLines to items 2 thru -1 of reminderLines
else
set remindersList to defaultRemindersList
end if
tell application "Reminders"
activate
-- create reminders
tell list remindersList
repeat with currentReminderLine in reminderLines
make new reminder with properties {name:currentReminderLine as text}
end repeat
end tell
end tell
-- optionally quit Reminders
tell application "System Events"
activate
set quitReminders to display dialog "Quit Reminders?" buttons {"No", "Yes"} default button "Yes"
if button returned of quitReminders is equal to "Yes" then
tell application "Reminders" to quit
else if button returned of quitReminders is equal to "No" then
-- if no is clicked, system events would still be active, so
-- let's activate Reminders again
tell application "Reminders" to activate
end if
end tell
@amelchi
Copy link

amelchi commented Feb 7, 2017

is it possible to add other properties? id, note?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment