Created
April 2, 2017 08:14
-
-
Save freklov/66fc367550e8b1e3b428685cd9f92543 to your computer and use it in GitHub Desktop.
AppleScript for Things: Copy Things to dos with a specific tag to a dedicated Reminders list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# things-tagged_reminders freklov 04/02/2017 | |
# Copy Things to dos with a specific tag to a dedicated Reminders list | |
# | |
# ATTENTION | |
# if two reminders lists with the same name exist, it is not forseeable which list is choosen | |
# | |
property ThingsTagName : "At Work" -- this is the name of the Things tag | |
property RemindersListName : "Things Import" -- this is the name of the Reminders List | |
# verify that Reminders list already exists | |
tell application "Reminders" | |
if not (list RemindersListName exists) then | |
display notification "A list with name " & quote & RemindersListName & quote & ¬ | |
" does not exist in Reminders. Please create it, first." with title "List does not exist" sound name "Blow" | |
return | |
end if | |
end tell | |
set countItems to -1 | |
tell application "Things" | |
set thingsTag to missing value | |
try | |
# ensure that Things Tag really exists | |
set thingsTag to tag ThingsTagName | |
set countItems to 0 | |
end try | |
if thingsTag is not missing value then | |
repeat with thingsToDo in to dos of thingsTag | |
tell application "Reminders" to ¬ | |
tell list RemindersListName to make new reminder at end with properties {name:(name of thingsToDo as text)} | |
set countItems to countItems + 1 | |
end repeat | |
else | |
display notification "A tag with name " & quote & ThingsTagName & quote & ¬ | |
" does not exist in Things. Please create it, first." with title "Tag does not exist" sound name "Blow" | |
end if | |
end tell | |
if countItems > -1 then | |
display notification "Added " & (countItems as text) & " todos, tagged with " & quote & ThingsTagName & quote & ¬ | |
", to Reminders list with name " & quote & RemindersListName & quote & "." sound name "Purr" | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment