Jump to content
kvonhard

Total N00b: Things 3 and Alfred: Making To Dos

Recommended Posts

Ok, y'all, I've spent like four hours trying to figure this out. I'm NOT a coder. Bear with me. 

 

All I want is to turn the sad little "Today" and "upcoming" Calendar events that I've imported from my iCal turn into handy dandy To Dos so I can check them off. 

 

I went to the Things website, read through the Applescripts and think that these (one or the other) should do it: 

 

tell application "Things3"

set TodayToDos to to do of list "Today"

repeat with TodayToDo in TodayToDos

end repeat

 

set UpcomingToDos to to dos of list "Upcoming"

repeat with upcomingToDo in UpcomingToDos

end repeat

end tell

 

OR

 

tell application "Things3"

set TodayToDos to to do of list "Today"

repeat with TodayToDo in TodayToDos

end repeat

 

end tell

 

tell application "Things3"

set UpcomingToDos to to dos of list "Upcoming"

repeat with upcomingToDo in UpcomingToDos

end repeat

 

end tell

 

I purchased Alfred complete with workflows since according to Things you should be able to use Alfred. 

 

I'm not exactly sure the order to start the workflow and then get it to work. I figured out the middle part where you shove the code. But after like four hours of Googling - I can't figure out how to build the whole thing because, clearly, I'm an idiot. 

Share this post


Link to post

Hi, @kvonhard, welcome to the forum.

 

Can you clarify what you're trying to achieve a bit? You want to turn some calendar events into todos, but where are the calendar events coming from? Are they still in iCal or already imported into Things?

 

If you can't code, then you need a very concrete answer. But we can't give you one without specific, concrete information first.

 

Also, your Things scripts don't do anything. They loop through every todo in the lists, but they don't do anything to or with the todos (there's no code between repeat… and end repeat).

 

Finally, a Things-related forum would be a better place to be asking questions about scripting Things. Certainly, some forum members use Things, and some of them know how to script it, but the majority of us can only help you with the plugging-it-into-Alfred part.

Share this post


Link to post

Thanks so much - I can try there as well and will. 

 

I want to take this:

 

1829731139_ScreenShot2018-09-13at3_38_50PM.png.307f611bfc2c358fb4f8c6caef3276b1.png

And make it automate into this:

 

671919783_ScreenShot2018-09-13at3_40_22PM.png.6d27fc88077d95b2726578a29dc656ba.png

 

My clients use a variety of task management (or not) automation. I managed to feed all my client tasks (asana and google sheets) into my calendar. And feed my calendar into the Today and Upcoming lists as appointments. But since most of them are tasks that I need "To Do" I wanted to make them automate into checklists.

 

When I read through the AppleScripts documentation on Things this is what it told me: 

Each predefined list visible in the left panel of Things can be accessed via AppleScript. Lists You can access the following lists of Things using their names:

- list “Inbox”

- list “Today”

- list “Anytime”

- list “Upcoming”

- list “Someday”

- list “Logbook”

- list “Trash”

 

They are predefined and you may not create any new lists using the make command. Each list contains collections of to-dos. Please note: the sort order of to-dos and projects accessed using “to dos” and “projects” collections corresponds to the UI.

 

For instance: Things AppleScript Guide 4

tell application "Things3"

set inboxToDos to to dos of list "Inbox" *To me this said create a ToDo list titled "inboxToDos" that pulls from the "inbox" list 

repeat with inboxToDo in inboxToDos *To me this intended to create a repeatable process where the inboxToDo above repeated for new inboxToDos as the inbox updated*

(--- do something with each inbox to do using inboxToDo variable)

end repeat

end tell

 

tell application "Things3"

set upcomingToDos to to dos of list "Upcoming"

repeat with upcomingToDo in upcomingToDos

(--- to-dos get sorted by start date - just like in Things UI) 

end repeat

end tell

 

I assumed that since the predefined "lists" included Today and Upcoming (the two things I want to make ongoing To Dos of since that's where the calendar items feed) I should pull the data from those and then use the definition of "Todaytodos" and "upcomingToDos" to turn the listed items into To Do checkable boxes after creating To Do Lists titled "TodayToDo" and "UpcomingToDo" ... 

 

And it also said the way to use Things was to use Alfred to create workflows.  I understand the basic fundamentals of coding but somehow I think this turned out to be more complex than I intended. 

 

Of course, once I even get the script complete, I'm going to come back here to figure out how to make the Alfred Workflow work. I couldn't figure out how to start the trigger if I want to try to get it to run continuously when new data is added to the Today and Upcoming .

Share this post


Link to post
43 minutes ago, kvonhard said:

set inboxToDos to to dos of list "Inbox" *To me this said create a ToDo list titled "inboxToDos" that pulls from the "inbox" list 

 

It depends what you mean by "list". inboxToDos is a kind of list, but not at all the same thing as what Things calls a "list".

 

inboxToDos is an AppleScript array (list) that contains references to every todo in list "Inbox".

 

43 minutes ago, kvonhard said:

repeat with inboxToDo in inboxToDos *To me this intended to create a repeatable process where the inboxToDo above repeated for new inboxToDos as the inbox updated*

(--- do something with each inbox to do using inboxToDo variable)

end repeat

 

It doesn't create a repeatable process, it immediately loops over every item in inboxToDos (and optionally does something with/to them).

 

43 minutes ago, kvonhard said:

then use the definition of "Todaytodos" and "upcomingToDos" to turn the listed items into To Do checkable boxes

 

I don't understand what you mean.

 

I don't have Things 3, so I can't say anything concrete, but from your description, I would expect that "appointment" and "todo" are two different types of thing, and you would need to create new todos from the appointments.

 

43 minutes ago, kvonhard said:

I couldn't figure out how to start the trigger if I want to try to get it to run continuously when new data is added to the Today and Upcoming

 

That's because Alfred doesn't work that way. Alfred is specifically designed to only do stuff when you tell it to. The rest of the time, it sits in the background trying to do as little as possible.

 

If you want to trigger your script based on something happening on your system, Alfred is not the tool for the job.

 

Also, there doesn't appear to be any way to get Things to notify you when it's added new data, so it probably can't be done automatically at all.

Edited by deanishe

Share this post


Link to post

Ahhh, thanks so much for all the help. Although - now that I realize you don't NEED a trigger, that helps tremendously in its own right so I'm glad I asked anyway.  I assumed I *needed* a trigger since trying to run things without one wasn't working. I appreciate the responses!

Share this post


Link to post

You need some kind of trigger. It's just that Alfred expects that to be either a Hotkey or you opening Alfred and entering a keyword.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×