I use Things 3 from Cultured Code to collect and organize various tasks. I would like to use KBM to retrieve the tasks from the "Today" list so that I can adjust the format of the task list for use with Obsidian (Markdown format), i.e. - [ ] Task. I expect this will require use of AppleScript to access Things 3... does anyone have any suggestions (or code examples) for how to approach this? Thanks!
Extra credit: it would be helpful to also retrieve the various metadata associated with the task, e.g., the project or Area of the task, notes, subtasks, due dates, tags, etc. Any pointers here would also be appreciated!
References:
I expect the work done by @Brian_Martinhere may be useful, though I have not yet parsed out the details with regard to my objective.
The AppleScript is modified from script Today of package Things of Raycast community scripts. Improved with the help of Cultured Code's Things 3 AppleScript Documentations.
I use & contributes to KM and Raycast, and both app is a great timesaver.
I thought of sharing my macro, for any new persons who wants to show number of Cultured Code's Things to-dos in the menu bar.
This is how it will look:
The first number, 11, is the to-do count from the Inbox, while the second number 5, right after the star, a symbol of Today in Things, is the to-do count from Today.
I have two triggers – every 30 min and when the Things app activates.
Here are the codes:
tell application "Things3"
«data utxt2605» as Unicode text
set todayTodos to to dos of list "Today"
set todayCount to the length of todayTodos
set inboxTodos to to dos of list "Inbox"
set inboxCount to the length of inboxTodos
set totalCount to " " & inboxCount & «data utxt2605» & todayCount
return totalCount
end tell
Selecting status menu items is difficult primarily because there is no easy way of specifying them - they don't have names so its hard to identify them.
You can use a Click at Found Image, although even that can be difficult as they often animate or change icons based on various states. If the icon does not animate or change state (or has a known state when you want to select from it), then this can be a good solution, followed by Insert Text by Typing "Menu Name%Return%"
To click relative to an image, you use the Mouse Click action, configure it to be relative to a found image, and take a screenshot of the desired area of the screen using Command-Control-Shift-4, and paste it into the image well on the action. The image has to be unique (which includes not being visible in the action if the image is small enough not to be shrunk in the image well) otherwise Keyboard Maestro will not know where to click. The Display option in the action will allow you to see where Keyboard Maestro is matching.
I have looked into it on multiple occasions, and will no doubt look in to it again, but its a difficult problem.
Indeed, that was my question. Menu bar itself has the macro group icon but the drop down menu, which are individual macros, do not have icons. They just have the name of the macro.
Use the “With title from Variable” option for the Display in menu bar title - that way it will be updated whenever the variable is updated - instantly when the variable is updated, and not at all when it is not, so much better than the periodic update.
Hi Peter, if I use "With custom title: %Variable%menuCount%",
my menu bar is showing the numbers. But, if I use "With title from variable: %Variable%menuCount%",
I get blank.
Do these two options refer to different variables?
I know this is an old thread but brand new to KBM and gave this a try. Every minute the new numbers for Inbox and Today are appended to my menubar. I've checked but I think I've built the macro group and macro correctly. Is there something simple I'm missing? Thanks for any help.