Alfred Workflow for Tinderbox - a first draft

As there are new scripting possibilities in TB8, it was time to create an Alfred workflow for Tinderbox.

First things first: Be careful not to destroy your TB files. Test first with some test files to see, how the workflow acts on your documents and if it causes any errors.
The next thing is: If anyone has good ideas, we can add them to the workflow. I only make a start, this is not meant to be the end of the workflow…

And last but not least, a big thanks to @ComplexPoint, who helped me with some of the code.

Now, here it is (always the latest version):
Tinderbox.alfredworkflow.zip (932.5 KB)

2 Likes

Here a short description of the possible inputs:

Using the keyword “tb”, you can choose a Tinderbox file. Either you open it directly by hitting the Enter key, or you can reveal the file in the finder by hitting Alt+Enter or you can create an inbox item by hitting Cmd+Enter.

If there is no Inbox container yet, a new one will be created at the bottom of the top level notes.

Using the keyword “tbc” (for Tinderbox Color) or a hotkey of your choice, you can assign one of eight colors to the selected TB notes, or choose the color picker for every other color. The names and values for the eight colors can be set in the workflow environment variables (the [x] in the upper right in the workflow preferences pane).

“tbb” in a browser captures the name and the url of a website. If you select some text, this will become the text of the note.

“tbd” for Tinderbox - Due, starts some sprints in Due from selected TB notes. Translated from KB Maestro to Alfred.

“tbr” or “atbref” without argument opens Atbref, with argument the Duck Duck Go search in Atbref.

“tbf” will open the forum, or some of the sub-forums.

“tbo” for “Tinderbox open”, shows files, that are opened already in TB. You can switch to a file here. alt and cmd act the same like in “tb”.

“tbs” stands for “Tinderbox screenshot”. At this time it acts still a bit “semi-automatic”: You can take a screenshot of the whole screen, or a rectangle (alt-key) or a window (cmd-key). After that you will be directed to the “tbo” part of the workflow, where you can choose an open file and paste the screenshot where you like, just by pressing cmd-V or using the “paste” command from the menu.

So for “tbb” you need to be on a browser and you may select some text, which will in turn become the $Text of the note.
For “tbc” (choosing a color) and “tbd” (Due sprints), you need to select one or more notes.
For “tbs” you should be on the screen, that you want to capture.
The “Due sprints” in more detail: http://forum.eastgate.com/t/script-timed-due-app-sprints-for-selected-notes/2266, just translated to Alfred…

And here is, what it looks like:

When typing another t (which occurs in every .tbx):

What I like especially here, is, that Alfred remembers, how often you open a file. So if you simply type “tb t”, the files, that you used most often, will appear at the top. But only, if you open them with Alfred (or he won’t know about it :wink:).

You can assign a hotkey for every part of the workflow:

And this is the color picker:

I took some colors for testing, but they can be changed. It’s a bit tricky, and I won’t explain it right now… but it’s doable
A little warning here: Selecting too many notes at once will be a little bit slow, but up to 50 notes it should happen within a second or so.
Changing color like this, using a hotkey, is quite fast: hotkey -> cmd+3 (or whatever color you like)… ready.

Nice. Thank you. I’ve found that most commands do not work as described.

Over here I have to key “tb” + space. Press return. Key “tb” + space again and start typing the name of a Tinberbox document.

No “Inbox” container is created. Cannot get this working over here.

I have to key “tbb” + return, then Alfred comes back up and before this command works I have to type the name of the file to clip the bookmark to.

Doesn’t work this way at all. I’d have to do a video capture to show what happens, when I have some time later.

This only creates a single Due entry – from only the first item in a selection of notes.

Not describes precisely enough, sorry.

Did you hold the cmd-key while choosing the file?
Not cmd + number, but choose the file and hold down the cmd key, while clicking or hitting enter.
You will be prompted then to enter the name and text for the note.
The Inbox Container should appear at the bottom of the top level of your document.

Normally a clipper simply clips to some big document or app. But as there are many documents in TB, I find it necessary to ask for the file to copy to…

Ok, I will wait for the video.

It looks like this, but in this Due entry, you can click the gear icon and then, quite at the bottom, you see a “due://…” entry with an arrow. When you click there, the next session will be started.

Thanks a lot for testing. I hope, my answers can help a bit and if anything seems confusing, perhaps you also have ideas how to do it a better / simpler way.

Ah, yes, you did say that (“create an inbox item by hitting cmd-enter”). That works.

(BTW, “alt-enter” maybe should be “option-enter”? At least on U.S. Mac keyboards?)

Still cannot get the screenshot routine working. It’s taking a lot of keystrokes. Actually simpler to just take a screen shot with SnagIt that is automatically added to Yoink, to drag into a note.

Suggestions

  1. Ability to assign a prototype that should be used for “create inbox notes”.
  2. Maybe a tb? command to show a help list of the other commands? (Not sure if this would work in Alfred.)
1 Like

I think, it is the same key, the alt/option-key, but you are right, it would perhaps be more precise to write “option”

The first part of the routine simply stores to the clipboard, and you have to paste it where ever you want yourself. You are right, this routine is not quite ready yet. It was a trial, and perhaps I will find something better.

Those points will come on the task list. What about a KA, which tells, that a note was created by Alfred? Would this make sense?
tb? is possible, I will add this asap, good idea!

Perhaps like this?

Only need to fill it with text (hopefully precise enough :wink:)

This is at least, how the screenshot is intended to work so far:

https://www.youtube.com/watch?v=sHydKkHuu_8

Perhaps you can tell a bit about your yoink / snagit setup? Sounds quite interesting, perhaps I could build something like this into the Alfred workflow… or at least parts of it. Pasting of an image into the text is not possible yet via osascript, so I must find some workaround (which should not be too complicated).

It’s just a Snagit preset that captures a screen region and points the resulting .png into Yoink.

Ok… that one might be more convenient, if someone has snagit installed.

I added “tb?” to describe the parts of the workflow. The workflow itself is at the top of the thread… HTH :grinning:

Great. Thank you.

This is a very useful set of inventions.

I edited my last post, while you answered, so I’m not sure, if you saw my questions, so I cut it and paste it here:

What do you mean exactly? Should the script create a prototype, or assign a prototype, or would you like to choose one of your prototypes, that are still there in the chosen document? Or should the inbox container get a rule for assigning a prototype to its children?
Another question, that came up, is, if it would perhaps make sense to only use one inbox for inbox notes, bookmarks and screenshots and to use 3 different prototypes?!?
:thinking:

When the Inbox is created it the $OnAdd for “Inbox” can be set – e.g., to:

$Prototype="protoNote";

Three inboxes make sense.

I changed the script a bit, so that now indeed an $OnAdd KA is created for the Inbox container, while the container is being created. So if you want to test it, you’d have to delete the Inbox container first and create a new Inbox note with Alfred. Then the Inbox has an OnAdd action

$Prototype="protoNote";

Now the “protoNote” is not for everyone, so I will test later, how to do it better with Alfred. Perhaps with an Alfred variable, then everyone could change the name of the prototype for his own needs…

You could consider an action like “tbp” that prompts for a prototype name and loads an Alfred variable.

If a note in Tinderbox is assigned a prototype that does not exist – say by manually putting a string into a note’s $Prototype attribute, or by doing it with an on-add action, then Tinderbox ignores the string. So, assigning “protoNote” via on-add when there is no such note as “protoNote”, then the outcome of doing this via Alfred will be nil.

So it might be important for the script to check for the existence of the prototype and create it, outside of the “Inbox”.

My suggestions are all edge cases, so I don’t want to be encouraging you to waste time on a case that will please 1% of the users of your tool.

I will have a look… and think about it, and what’s possible.

There are no users yet :joy: (and this workflow is only for the forum)

And as I said, it is a first draft of an Alfred workflow. Everyone here in the forum (who uses Alfred) is invited to contribute their ideas to the workflow.
Many of the users here have a much bigger mileage with TB than myself, so it’s quite valuable to get good ideas as input

Hi, Kay @cremoer, i was wondering if you had any more thoughts about this. I too have not been able to make your workflow work, unfortunately, but i can see its value.