How to clear unnecessary link types

In my project, I have unnecessary link types with strange names: "" (just empty), "place", and """""""""""". Their appearance is likely due to an error I made when creating ziplinks in one of my notes.

I delete them using the Links Browser, but every time I reopen the project, they reappear. Unfortunately, the project contains more than 4000 notes, making it impractical to manually search for the notes containing these problematic links.

The solution, therefore, seems to be either finding these notes or identifying these link types specifically—but I have no idea how to accomplish this.

(I tried using an agent with the query $OutboundLinkCount>1, but for some reason, it includes notes that don’t have any outbound links at all.)

I would greatly appreciate any help or suggestions.

Be sure you’re using the latest release; a backstage release from a while back had this misbehavior.

I have 10.2.0
mac OS Sequoia 15.5

For those who may encounter this issue.
The only workaround I’ve found so far is as follows:
Make the unnecessary link type easily noticeable via the Link Browser (see the attached screenshot). This will also allow you to see how many such link types exist in your document. Afterward, skim through your document in Map view—the unnecessary links will be clearly visible (provided the notes aren’t located in different containers).

Note, that before you ‘fix’ the actual link types, you need to fix the links using the ‘bad’ link types.

I tried just renaming the link types. It appears to work but on re-closing/re-opening the app/doc the ‘bad’ typed links and link types are still there.

You could use linkTo() and UnlinkTo(0 to delete make new links of the good link type and delete links of the bad type, then check explicitly for any use of the bad type. But, with 4k ‘bad’ links using BBEDit or similar is faster cleaner. Here is link data from a small TBX where the above bug has cloned link type text to "test" and ""test"":

In the above there is a single link each of the ‘correct’ test’ and each of the quote-enclosed versions. Here is the link types listing for the same doc:

So, first we fix the links. We use Find & Replace in BBEdit (you can use a similar tool):

Note the ‘find’ regex matches ‘bad’ type variants using one or two sets of enclosing straight double quotes. It the bug had run away such that you had types like """""""test""""""" the regex would match those two as (")+ matches one or more consecutive instances of string "+. Make sure you replace the ‘bad’ data both before and after the link type name.

Don’t forget to work the fix on a copy of the original TBX file in case you mess up.

After running the replace is run, notice on;y the correct test link type is used:

In the Link type inspector select the ‘bad’ link types like "test" and delete them as no links now use that link types. So compared the grab above, the link type listing the TBX’s XML will look like:

Save the edited TBX, close, re-opening in Tinderbox and check all looks OK.

@eastgate. I may be missing a complication, but it would be useful if I could rename a Link Type defined in a TBX to the name of an existing link type and essentially do the rename and ‘merge’ above in-app. I can see it might be one of the few places where an “are you sure” dialog might be warranted before merging two linkTypes’s worth of links to use just one link type.

For now as the issue raised is a glitch only affecting those who used a particular Backstage beta build, the BBEdit approach to a fix should suffice as once done using a public release won’t re-trigger the issue.

1 Like

I found one type of bad links manually and reassigned them to another type, then deleted the bad type. After restarting Tbx, those bad links are no longer recreated.
Thank you so much, Mark, for such detailed recommendations. I’ve never edited a Tinderbox file before, I hope it all works out.

1 Like

Thank you, Mark!
It worked.