Using a Stream Deck to Control Things

A close-up of a Stream Deck device and part of a keyboard on a wooden desk. The Stream Deck, with 15 programmable buttons, displays various icons and labels, including "Home," "Someday," "Saturday," "Tomorrow," and "Complete." The keyboard, partially visible, features standard keys, including "esc," "tab," "caps lock," and "shift." The scene suggests a workspace setup for productivity or content creation.

I made a YouTube video showing you how I am using a Stream Deck, along with some AppleScripts in Keyboard Maestro, to improve my control of Things. Check out the video and find all of the resources in this post.

Video

AppleScripts From the Video

If you are interested in implementing a similar workflow to what I shared in the video, I have assembled the scripts and tools I shared in this video.

KM Link

In the video, I failed to point out that I am using the Stream Deck plug-in “KM Link” to connect a Stream Deck button with a Keyboard Maestro macro. I Find KM Link to be much better than the official Keyboard Maestro plug-in.

If you want to run AppleScripts via a StreamDeck and Keyboard Maestro, you will want to install the free KM Link plug-in.

Move to Monday

This AppleScript will calculate the next Monday after today and then assign that date as the When date to the selected item in Things. I added some extra comments to the code from what you see in the video, but it is the same script.

-- This script schedules selected to-dos in Things 3 for the next upcoming Monday

-- Start interacting with the Things 3 application
tell application "Things3"
    -- Get the current date
    set today to current date

    -- Calculate the next Monday
    -- Get the current day of the week (1 = Monday, 7 = Sunday)
    set dayOfWeek to weekday of today

    -- Calculate how many days to add to reach next Monday
    -- The formula ensures it works correctly regardless of the current day
    set daysToAdd to (9 - (dayOfWeek as integer)) mod 7

    -- If today is Monday, set it to next Monday (7 days from now)
    if daysToAdd is 0 then set daysToAdd to 7

    -- Calculate the date of next Monday
    set nextMonday to today + (daysToAdd * days * 1)

    -- Schedule selected to-dos for next Monday
    repeat with selectedToDo in selected to dos
        -- Set the schedule date of the current to-do to next Monday
        schedule selectedToDo for nextMonday
    end repeat
end tell

Move to Saturday

This AppleScript will calculate the next Monday after today and then assign that date as the When date to the selected item in Things. I added some extra comments to the code from what you see in the video, but it is the same script.

-- This script schedules selected to-dos in Things 3 for the next upcoming Saturday

-- Start interacting with the Things 3 application
tell application "Things3"
    -- Get the current date
    set today to current date

    -- Calculate the next Saturday
    -- Get the current day of the week (1 = Monday, 7 = Sunday)
    set dayOfWeek to weekday of today

    -- Calculate how many days to add to reach next Saturday
    -- 'Saturday' is a constant in AppleScript equal to 7
    -- This formula works for any current day of the week
    set daysToAdd to (7 - (dayOfWeek - Saturday)) mod 7

    -- If today is Saturday, set it to next Saturday (7 days from now)
    if daysToAdd is 0 then set daysToAdd to 7

    -- Calculate the date of next Saturday
    set nextSaturday to today + (daysToAdd * days * 1)

    -- Schedule selected to-dos for next Saturday
    repeat with selectedToDo in selected to dos
        -- Set the schedule date of the current to-do to next Saturday
        schedule selectedToDo for nextSaturday
    end repeat
end tell

Move to Area

This AppleScript will move your selected action item to a predefined area in Things and assign an associated tag. In this case, the area is “🏥 Work”, and the tag is “work”. You will need to edit this code to match your setup by replacing the defined area and tag.

I added some extra comments to the code from what you see in the video, but it is the same script.

-- This script moves selected to-dos in Things 3 to a specific area and adds a tag

-- Start interacting with the Things 3 application
tell application "Things3"
    -- Define the target area where tasks will be moved
    -- Change "🏥 Work" to the name of your desired area
    set targetArea to first area whose name is "🏥 Work"

    -- Define the tag to be added to the tasks
    -- Change "work" to your desired tag name
    set theTag to "work"

    -- Loop through each selected to-do item
    repeat with selectedToDo in selected to dos
        -- Move the current to-do to the target area
        move selectedToDo to targetArea

        -- Get the current tags of the to-do
        set theTags to tag names of selectedToDo

        -- Check if the desired tag is not already present
        if theTags does not contain theTag then
            -- Add the new tag to the existing tags
            set tag names of selectedToDo to theTags & ", " & theTag
        end if
    end repeat
end tell

Make a Frog

This AppleScript will assign a When date of tomorrow your selected action item, prefix a 🐸 emoji to the action item’s title, and assign a “frog” tag.

The “frog” tag will have to already exist in Things, this script can not create a new tag for you.

I added some extra comments to the code from what you see in the video, but it is the same script.

-- This script modifies selected to-dos in Things 3 by adding a frog emoji to the title,
-- adding a "frog" tag, and scheduling them for tomorrow

-- Start interacting with the Things 3 application
tell application "Things3"
    -- Calculate tomorrow's date
    set tomorrow to (current date) + 1 * days

    -- Loop through each selected to-do item
    repeat with selectedToDo in selected to dos
        -- Add frog emoji to the beginning of the to-do's title
        -- You can change "🐸 " to any other emoji or prefix if desired
        set name of selectedToDo to "🐸 " & name of selectedToDo

        -- Add the "frog" tag to the to-do
        -- First, get the current tags of the to-do
        set currentTags to tag names of selectedToDo
        -- Check if the "frog" tag is not already present
        if currentTags does not contain "frog" then
            -- Add the "frog" tag to the existing tags
            -- You can change "frog" to any other tag name you prefer
            set tag names of selectedToDo to currentTags & ", frog"
        end if

        -- Set the When date of the to-do to tomorrow
        schedule selectedToDo for tomorrow
    end repeat
end tell

Clear to Neutral

You can read more about my Clear to Neutral process by checking out this blog post. It is essentially a daily review process that helps me create some closure to the workday and helps me prepare for tomorrow.

This write-up is from my days as a teacher, so the specific elements are different for me now, but the general idea is the same.

Tag Maintenance in Things Blog Post

If you are interested in more tag-centric automation for Things, I have another blog post where I share an AppleScript for maintaining tags in Things.

This script helps cover circumstances where I did not use the “Move to _” scripts on my Stream Deck and a few other situations.

Closure

I hope these resources have helped you; please let me know in the comments if they did or if there is something I should consider adding to my workflow!

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.