Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automatically set repeating tasks tagged ‘Evening’ to be done this evening, in Things 3 — updated versions on gitlab https://gitlab.com/benjamineskola/things-scripts/-/blob/master/evening.applescript
-- run first thing in the morning, e.g., from cron
tell application "Things3"
set theToken to "your-auth-token"
set theTodos to to dos of list "Today"
repeat with aTodo in theTodos
set tagList to tags of aTodo
repeat with aTag in tagList
if (name of aTag as text) is "Evening"
if class of aTodo is project
set urlCommand to "update-project"
else
set urlCommand to "update"
end if
set theUrl to "things:///" & urlCommand & "?auth-token=" & theToken & "&id=" & (id of aTodo as text) & "&when=evening"
open location theUrl
end if
end repeat
end repeat
end tell
@patrickrushton

This comment has been minimized.

Copy link

@patrickrushton patrickrushton commented Aug 29, 2020

This is great! Is there a simple way to remove the "Evening" tag from the tasks once they've been moved to the evening?

@patrickrushton

This comment has been minimized.

Copy link

@patrickrushton patrickrushton commented Aug 29, 2020

EDIT - ignore what I wrote below. This removes all tags from the evening todos, but I only want to remove the "evening" tag.

Worked it out - adding this after line 18 removes the Evening tag once they've been moved. I like this because it cleans up the Today view, but I understand others might want to keep the tag.

delete tag of aTodo

@patrickrushton

This comment has been minimized.

Copy link

@patrickrushton patrickrushton commented Aug 29, 2020

This achieves what I was aiming for:
delete tag "Evening" of aTodo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.