Problem with "linkPath"

“Publish from Tinderbox to DEVONthink”. That’s not a thread I know well (as I don’t use DEVONthink enough to know it well) and doing a search on the thread, I find only a single reference to ‘linkPath’ and it is thin this post.

Tip: at the bottom of each post in a thread is a symbol like this:

Problem with "linkPath" - Q & A - getting started with Tinderbox - Tinderbox Forum 2022-01-09 21-34-15

Click that and a pop-up shows a link to that post , pre-selected for easy copy-paste to make a reference link as I did above. FIWI, this is found in all Discourse-based forums.

In that post is included this code, which explains the confusion:

    var linkPath($HTMLExportPath(l));

The immediate giveaway is the first line starting var, indicating a variable is being defined, called ‘linkPath’. As that now clashes with the linkPath operator added later in v9.0.0, how the old code would work in v9.0.0+ is uncertain as it is creating a name collision by trying to make a variable name that is already used by a build-in operator. On fairness, when the old code was written in 2018, such a potential name close did not occur.

This is timely occasion to flag up why I use prefixes for variables and loop variable - i.e. where the user gets to name the operator. That’s not because I’m smart, just cautious. In the above scenario, I would have named the variable vLinkPath so even today the code would work. Plus, reviewing the code years later I’d know the tern was a variable due to the ‘v’ prefix to a CamelCase word.

Another learning point here is the problem of action code in very long-lived threads—or very old ones found by search; action code has come a long way since its debut back in 2001! For all but simple issue there is a chance of later changes, so do follow through the thread to look for corrections. That would have shown the demo TBX has been updated several times and version 0.5.4 was offered in this post in December 2020.

Interestingly the version 0.5.4 TBX file, can be seen that ‘linkPath’ was being used in a note called “Publish single note to DEVONthink”, which is problematic and should likely be fixed.

As to your last point, the above project is quite complex an ideal starter project. I quite appreciate you want to do things with DEVONthink, but you might find it helpful to try some simpler projects and read the available docs and tutorials and actions before using more complex projects.

HTH :slight_smile: