This is a Keyboard Maestro macro group for calling up actions on selected tbx notes.
Set it up
Unzip the file.
Place the List of Commands.txt file at a location where it will spend the remaining of its days.
Open the macro and head to the 01) Read this first macro.
Type the location of the text file where the commands will be stored. (There is an example provided).
Change the shortcut of 02) Tbx Commander.
You’re set.
How to use
The macro works very much like a stamp.
Select the notes it should act on.
Type the shortcut.
Choose an action
The following options are already built-in:
Add new command.
Edit command list.
The add new command option with call up a dialog for you to type the command. If you wish to save it for later use, give it a name/description in the next dialog box. It will then run the command.
The actions are stored in a plain text file, one command per line followed by __ (two underlines) and a brief explanation without any linebreaks. Here is an example:
£££__Edit file with commands
¢¢¢__Edit file with notes
$DisplayExpression='$Name+" ("+$ChildCount+")"';__Display Expression:title & child count
$Name = $Name.replace("\n","");__Fix text:\n in name
var theText; theText = $Text; $Text = theText.replace("\n\n\n","\n\n");__Fix text:3 linebreaks → 2 linebreaks
$Name = $Name.lowercase__Fix text:Make title lowercase
I think I’ll be using this a lot as now there’s only one place to change commands (instead of curating stamps in one Tinderbox and updating them in other documents).
One minor thing: Users who don’t use the beta have to change this line
tell application "Tinderbox 9"
in macro “02) Tbx Commander”'s last action group to
tell application "Tinderbox 8"
And for those who are not familiar with importing macros: You first have to enable the macro group, with the macro group selected use menu View > Enable Macro Group (or the contextual menu).
Hey @Bernard-0 I’ve not been able to get this script working on Big Sur. @TomD and I just verified that it does not work on his Big Sur machine either. Have any ideas? @TomD has verified that it works on his Catalina machine.
I think it is unlikely to be an OS problem and more likely that you haven’t given Keyboard Maestro all the necessary permissions. The script itself is nothing special. For instance, try running this from script editor on some dummy note:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application id "KM*E"
set theCommand to ""
set theCommand to value of variable "theCommand"
end tell
-- for testing purposes:
set theCommand to "$Name = 'Come to the dark side of the force and get a free cookie'"
tell application "Tinderbox 9"
-- set theNote to item 1 of the selection in front document
-- set theNotes to notes of front document
set theNotes to selection in front document
repeat with theNote in theNotes
act on theNote with theCommand
end repeat
end tell
Verified. The same script (synced and verified) on my MacMini (Catalina) worked perfectly, Big Sur MacBook Air version failed. Nothing happened. Other KM scripts work fine.
This is my n=1
Not sure if anyone else on Big Sur has had success.
Tom
Dear Mr.Bernardo Vasconcelos,
Thank a lot for distributing your Keyboard Maestro macro.
This macro is more than enough for the “string” search function I was looking for.
I was taking a refresher practice on Tinderbox while watching a VIDEO created by Mr. Michael Becker & awards, and I was wondering how I could “search” and create a “quote” or “link” to a “thought” from a Tinderbox file I had created. I have been wondering.
This macro does exactly what I wanted it to do.
Thank you very much for distributing such a useful macro.
Sincerely yours, Kunimitsu Wakamatsu
P.S
My environment : Mac OS10.14.6 Mojave, Keyboard Maestro9.2,
Tinderbox 8.5.1 & 8.6.2
Since I can use this macro, it looks like I do not have to narrow down to just one Emacs27 org-roam, which I was using together, and switch all my descriptions to Emacs27.
Thank you, Mr. Wakamatsu (@WAKAMATSU), for your kind words.
I am using Big Sur, so that is not the cause of the problem. Did you try to run the script from Script Debugger or Script Editor? Also, did you try it on Tbx 8 or 9? The script is set for 9 as you can see, so if you were to try on Tbx 8 you would need to change tell application "Tinderbox 9" to tell application "Tinderbox 8".
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Tinderbox 9"
set theCommand to "$Name = 'Come to the dark side of the force and get a free cookie'"
set theNotes to selection in front document
repeat with theNote in theNotes
act on theNote with theCommand
end repeat
end tell
Just to confirm: The test script works here with Tinderbox 8.9.2 running under Big Sur 11.3.
When a script says it “Can’t get document 1” it is complaining that it can’t find the front document.
Assuming there was a Tinderbox document open, then this could be a security settings thing.
If you haven’t done so already, go to System Preferences > Security & Privacy > Privacy > Accessibility and make sure Script Editor and Tinderbox are listed and checked under ‘Allow the apps below to control your computer.’ (If they aren’t you’ll need to unlock the lock at lower left before making changes to the list).
If that is all in order, then try restarting your Mac.