Linking (multiple) notes using the keyboard in map view (TB 6.4.)

I am using Tinderbox 6.4.0. I have a lot of notes which I would like to link using the keyboard. Is it not possible to link two or more notes at once in the map view? Is it not possible to do so with the keyboard? Or am I missing something.

Link to what? Another note? Each other?

Would be helpful to know a bit more about what you’re looking to do.

(Just generally: linking is a mouse-oriented activity.)

1 Like

Yeah, another note. Let’s say I have four notes: A, B, C and 1. Just going by intuition I’d want to either select A,B,C in the map view (with the mouse, if I have to), press a keyboard shortcut and tell TB (either by putting it into a search box or by selecting the note) the note “1” these notes should be linked to, or vice versa: first the source note then its new children.

Tinderbox 7 Quick Links are a handy way to add text links without using the mouse.

1 Like

Being able to quickly create text links is great. But I guess you can’t do either of the things I asked: 1) connect multiple notes at once to a new parent with mouse or not 2) do so with a keyboard.

Than let me ask you this: Can you link from (or to) a source note as a note link in the map view while using the keyboard?

Interesting. Sort of a “bulk-linking” activity.

1 Like

The bit I don’t get is the fragility of the process. In our mind’s eye everything is simple, but in reality less so. I’m assuming the concept there is you select a bunch of notes and the first selected is then linked to all the others. But practically, how unambiguous is the ‘first’ selected item? (i.e. in the software’s rather than the mind’s eye view)

1 Like

Well, the concept could be realized in a bunch of different ways. Let’s say the process is this:

  1. Select one or more notes in the map view
  2. Press a shortcut or a button in the UI
  3. Select one note in the map view which can’t be one of those you selected in step 1
  4. TB links those notes selected in step 1 to it’s new source selected in step 3 (that means they are linked from the source, not the other way around, which is important, since TB seems to only know one-way links)

It might be desirable to switch step 1 and step 3. It might be prefered to enter the name of the source note instead of selecting it. Whatever is most unambiguous, I guess, would be a good heuristic to use here.

We could go into more and more detail, I guess. But as far as I can see, thi is a pretty solid description, no? :wink:

1 Like

I btw. almost have a solution for the simpler task of linking one note with one source just with keyboard strokes:

  1. Select a note in the map view
  2. Press cmd+alt+x (open text window)
  3. Press cmd+shift+l (that’s a lower case L; link park space)

This opens the search box in map view and asks for a link from the selected source note. However, since the focus is on the text window and not on the link park space’s search box, we can’t write into it. We can close the text window with cmd+w, but no amount of pressing the tab-key, nor using <
or > let’s us focus on the search box. Clicking works, but who wants to click? :wink:

AFAICT the link park mechaism isn’t enabled in tear off windows. One reason is that it isn’t possible to drag links outside the current window (not possible since moving to Apple frameworks in v6.0.0). However, if the action above were to set the link part of the front window to a parked (basic/text) link, then the link park could be used to drag a link. I can still see lots of ways this could end up with an unexpected result when to the user does things different from that they imagined (all too often for this (beta tester) use.

Since you ask - me :grinning:. I’m not a touch typist, unlikely to become so, but I get by. I will generally click first. People’s muscle-memories differ. The app needs to cater to both keyboard-centric and those not. All that said, I agree the general point about keyboard -based actions not working being an anoyance.

1 Like

It is, in the sense that it opens the link park space search box in the main window. Screenshot:

As you can see it looks a bit wonky, maybe it’s even a bug that in this particular tear off window the above mentioned keyboard shortcut works, even though it shouldn’t. Of course, I’d rather have it work than have it removed, but if what you say is true, than I guess, this shouldn’t happen. This might only be a thing in 6.4, though. I don’t know…

I don’t understand this. Do you mean that by selecting a certain note in the map view and pressing the shortcut, that this could be a desired behaviour, or are you suggesting that this should be the behaviour for the whole workaround (opening note window, pressing cmd+shift+l; in theory: closing the note window and navigating via tabor something to the link park space search box, entering $name of desired note, pressing return) I presented? In the first case this would be very nice indeed. In the second case, I admit with a heavy heart, that this would be too ambigious, I think and simply preventing the tear off window from opening up things in other windows, should be the way to go.

Of course, I’d take what I can get and would never admit that, for clarity’s sake, option number two should be avoided.

Fair enough.

Using v7.0.2b255 (the v7.0.2 release) I can’t replicate the scenario in your screen gabs following the steps described.

I thought you were proposing to park a link, then, make a selection in the view pane, drag from the link park onto any of the selected notes and all be linked.

1 Like

Aha! That’d be an ambiguous way to go about it, indeed. No, my half-working workaround had nothing to do with that. And now that we know, that this bug has been squashed, it makes sense that you didn’t know what I tried to say. :slight_smile:

Good that it works that way in my version of the app still, since I now have hacked together a working solution:

  1. You need Keyboard Maestro for this.
  2. Download (and rename to QuickLinkNote.kmmacros) or create the following macro:

  1. As you can see, the macro is triggered by pressing ctrl+alt+shift+l. This assumes you’re in the map view.

Basically it takes care of pressing all those extra shortcuts and then even clicks for you.

P.S.: In bigger files it might be needed to put in pauses in between those working steps.

You can do bulk links using the linkTo action code in a stamp.

I made a stamp which was simply:

linkTo("incoming")

and it worked.

4 Likes

That’s nice! Now we only need to find a way to get/set the parameters of that function somehow. Is there a way to get the $name of a selected note in the map view, so we can work with it? Than I could see a solution that uses a stamp for setting the source note and another for the actual linking.

Yes you can. You’ll need a note somewhere whose $Text you can use as variable storage. Let’s call that note “namer”

So stamp 1 is used when you have the destination note selected

$Text(namer)=$Name(this)

and stamp 2 is used while you have the origination note(s) selected

linkTo($Text(namer))

I’m sure there are other things you can do along these lines, and @mwra can propose a more canonically elegant syntax. But, this works for me over here. Thanks @pat for the germ of the idea.

2 Likes

linkTo("incoming"); should create a note to the first note (by $OutlineOrder) with the $Name ‘incoming’.

If you want to link to several notes (assuming unambiguous $Name) you could do linkTo("incoming;out;other") to llink to ‘incoming’, ‘out’ and ‘other’. More re-usable is to put put the list in a Set or List type attribute, e.g. for example the built-in sandbox List attribute MyList. Now the stamp is:

linkTo($MyList);

Now each stamped note looks in its own $MyList and uses the value(s) there to make link(s) as pertinent. You can use linkFrom(), unlinkTo() and unlinkFrom() in the same way. See more on linkTo() here.

I thought I’d tie together the last two posts which got made at the same time and thus may appear in opposition. I prefer @PaulWalters’s solution but as he suggested I’ll tweak the syntax a bit. We’ll use his ‘Namer’ note concept but we’ll use $Path data rather than $Name to avoid wrong links when your document grows and note titles may not remain unique in the doc. We’ll also cover setting/resetting Namer values for both a single target link or multiple target links, and applying single/multiple links for all currently selected (stamped) items. Here, we’ll assume ‘Namer’ is at root so its $Path is "/Namer". In the multiple target example, we use a Set-type attribute rather than a List-type, as in my earlier post as a Set automatically de-dupes avoiding accidental multiple linking (of same source/destination).

Single link target

To set the name of the target link:
Stamp name: “Set Namer single”.
Code: $MyString(find($Path=="/Namer")) = $Path(this);

Select all source notes and stamp to link to the note stored in Namer:
Stamp name: "Link-all single"
Code: linkTo($MyString(find($Path=="/Namer")));

Multiple link target

Ensure the Namer list is empty before adding new targets:
Stamp name: “Reset Namer multiple”.
Code: $MySet(find($Path=="/Namer")) =;

Add a single new item to the Namer target list:
Stamp name: “Add to Namer multiple”.
Code: $MySet(find($Path=="/Namer")) = $MySet(find($Path=="/Namer")) + $Path(this);

Select all source notes and stamp to link to each note stored in Namer’s list:
Stamp name: "Link-all multiple"
Code: linkTo($MySet(find($Path=="/Namer")));

Customisation

If you prefer to put the Namer note in a root container “Codes”, then amend all paths in the examples above to "/Codes/Namer" - or to whatever path you choose in your project.

To reverse the link direction, or remove links, substitute linkTo() with linkFrom(), unlinkTo() or unlinkFrom(). In all cases you can provide an optional second argument to set a link type (or limit link removal to only that link type). For example, to link using link type “example”: linkTo($MyString(find($Name=="Namer")),"example"));. If you want, you could even store the latter parameter as another String-type attribute in Namer: linkTo($MyString(find($Name=="Namer")),$MyStringB(find($Name=="Namer")));

1 Like

Thanks Mark. I knew you could betterfy it :smiley:

1 Like

Nice work! The only thing left to do now was to set up keyboard shortcuts:

These can be set up by opening up the system preferences of os x, open the keyboard preference pane, click on the shortcuts tab, choose the app shortcuts option in the menu on the left side, pressing the button with the + on it and in the new window selecting the tinderbox app, then entering the name of the stamp exactly as it appears in the stamps menu and finally choosing a shortcut that isn’t otherwise used by neither tinderbox itself nor can it be any global shortcut and you’re good to go.

Thanks so much for your help everyone!