Hello everyone! In order to use a Tbx file as a Getting Things Done general folder, I’d like to be able to write down a note on the fly while doing something with another tool — as if I had a Things or an Omnifocus quick entry — and drop it off into a specific container, an inbox. Do you know if Keyboard Maestro does it better than Alfred or if any other tool could handle it easily? Thanks for your suggestions.
I do this on-the-fly by using Tot, which has an Eastgate-made integration Tinderbox and is available on macOS, iPhone/iPad and Watch. Integration via File > Watch > Tot. That can be added to any or all Tinderbox document.
I would use Drafts.app for that (though I don’t use it much). I’ve found the dictation option to be remarkably good when I’ve used it – and you can send the text anywhere, not just to Tinderbox.
We did a meetup on this a long time ago: Tinderbox Training Video 63- Export Drafts Note to Tinderbox - #28 by webline.
If you want to do something that doesn’t involve a watched folder, you could create an AppleScript and invoke it with a keyboard shortcut from FastScripts, though I think you can call an AppleScript with any launcher-like utility, like LaunchBar, Alfred, Keyboard Maestro.
I haven’t played with it for a while, but I just verified I could invoke a script with a keyboard shortcut while I was writing this reply. The note is created in Tinderbox (the marmot, my blog file, in this case) in the background.
As written, this script will ask you for the $Name of the note and then create the note and use the contents of the clipboard for the $Text.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set postTitle to display dialog "Post title?" default answer ""
copy the result to {button returned:buttonPressed, text returned:postTitle}
tell application "Tinderbox 10"
set this_moment to (the current date)
set nmMonth to (month of this_moment) as string
set nmYear to (year of this_moment) as string
set thePath to "Archives/" & nmYear & "/" & nmMonth & " " & nmYear
tell document "Nice Marmot (Production).tbx" -- suffix .tbx required on my machine
-- this is how to specify a note down in the hierarchy:
set theContainer to find note in it with path thePath
set newNote to make new note at theContainer
tell newNote
if postTitle is not missing value then set value of attribute "Name" to postTitle
set value of attribute "Text" to the clipboard
end tell
end tell
end tell
Maybe this is kind of what you’re looking for?
Than you for your suggestions. After a long time to try out various Mac-GTD tools with more or less success, I’m taking Tinderbox up again as a personal assistant. What else?
I also use Drafts for this.
Maybe this is kind of what you’re looking for?
Yes, exactly and I’m trying to use your script suggestion, but, as you can see on the picture below, I can’t find the right path for one of my containers. The path is /GTD/INBOX, but when I insert this one or another, I get an error message: “The GTD variable is not defined.” Do you know how I could fix that? Am I missing something? Thank you for your help.
The line you highlight should be:
set newNote to make new note at theContainer
Note the script errors if the container (in theContainer') is missing. You likely want to ad—for production use—a test that
theContainer’ has a value before using it.
Another for Script Debugger. Not used it for month (or any AppleScript for that matter) and it got me to a solution in no time.
I’m afraid I should have added some context to my script.
This was part a “daily notes” type TBX, “Captain’s Log.” So there are functions and Rules that create containers for each day, with the path defined by the root level (“Archive” or something) followed by calculated containers for each year, month, and day.
You may have a fixed “Inbox” container with a static, defined path, which wouldn’t require all the construction of “thePath” as set out at the start of the “Tell” segment.
Does that make it a little clearer?
Update: This is much of the discussion about Captain’s Log. (I think. I should have checked.)
Thanks for your answers @mwra @dmrogers.
I’ve tried to debug my own scripts attempts with Script Debugger, but it is completely out of my depth.
I’ve tried to modify my script from your suggestions and this is a new one, but there is still the same error message. It does not work yet, but I think I’m very close to get my quick entry:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set postTitle to display dialog "Titre ?" default answer ""
copy the result to {button returned:buttonPressed, text returned:postTitle}
tell application "Tinderbox 10"
set thePath to "INBOX/" & "/"
tell document "GTD.tbx"
set INBOX to find note in it with path INBOX
set newNote to make new note at INBOX
tell newNote
if postTitle is not missing value then set value of attribute "Name" to postTitle
set value of attribute "Text" to the clipboard
end tell
end tell
end tell
Can’t test your code, but re-using the INBOX
variable name might be biting you. What if you try:
set leConteneur to find note in it with path INBOX
set newNote to make new note at leConteneur
If AppleScript Debugger gives you an error dialog, whilst the error message itself may make no immediate sense to us occasional scripters, look at what object (i.e. a named thing in your code) is not working. Also, for debugging in SD, look at the variables panel (marked #6 in the diagram here), what is the value of INBOX
when the script has run? Is it what you expect?
HTH, as writing AppleScript scripts can be maddening as the supposed ‘natural language’ approach is anything but and I’m conscious you’s also not working in your own first language.
[edit: my error, the tool is Script Debugger, not AppleScript Debigger]
For the AppleScript Debugger-curious, Late Night Software offers 20% Edu discounts (e.g. if you are a student or academic). There is also a seemingly free ‘lite’ version Feature Comparison | Late Night Software. I think the=‘lite’ version is effectively a non-time limited demo mode with some features (only needed be power users) gated out. Disclosure: I use the full app registered on an Edu discount.
Mark’s on the right track, but I think you have an unnecessary “/” at the end of thePath. Also, since we’re defining each of the elements of your document as variables, use the variables in the script. I.E. don’t refer directly to “Inbox,” refer to the variable thePath. And use variables for (“newNote”, “leConteneur”, etc) for everything.
I’m sure I confused the matter by writing that you could refer to the static elements of the path in Tinderbox. I think you still need to assign all those elements to variables for AS to work with them.
So I think it should look like this:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set postTitle to display dialog "Titre ?" default answer ""
copy the result to {button returned:buttonPressed, text returned:postTitle}
tell application "Tinderbox 10"
set thePath to "INBOX/"
tell document "GTD.tbx"
set leConteneur to find note in it with path thePath
set newNote to make new note at leConteneur
tell newNote
if postTitle is not missing value then set value of attribute "Name" to postTitle
set value of attribute "Text" to the clipboard
end tell
end tell
end tell
I’m not an AS expert, but I think you have to assign all the objects (paths, notes, attributes) within the document to variables, then refer to the variables within the script to assign values.
I think that’ll work.
It works! Thank you!
Happy to help. Sorry for not being clearer. AS is a powerful lever for taking the most advantage of Tinderbox.
No time for deep testing now, but a hole in my ‘light’ docs on AppleScript in Tinderbox exposes a hole about how you make a new note at a specific location (path) in the current TBX. I’ll try and make/add example code for that.
Regarding the originally posted question, I tried Alfred on my iMac but tripped over too many key conflicts with other apps. No patience to chase and resolve all. Deleted Alfred.
Having noted in the thread above that aTbRef didn’t explain how you created a new note, via AppleScript, in a non-root location, I’ve updated this page to reflect that fact.