Thanks. Be aware the method suggested above only works on outbound notes so,
Also there is no way to query only for notes that have link(s) whose destination
(actually a path) contains a certain folder.
The best you can do is, I think:
- make an agent that collects all notes with outbound basic or text links
- for each alias, iterate (li.e. loop through) all the links and if the link type is untitled, then:
- check the link’s destination path,
- if that path includes the container
Sources
(which must be case-sensitively a unique title within the entire TBX)
- change the links link type to Reference
No, the destination
describes the path of the note to which the link points. Action code can only access link data for a note’s outbound links. The later is a limit desire cannot work around. So, your solution has to work from the context of notes with outbound links.
No! They are text links of type “*untitled”, as explained above
You can’t select links this way. You can only look at a note’s links, cycle trough and for each one check the path stored as the `destination, etc., as described above.
To confirm, blending your desired outcome and possible avenues for code, we need to check all note’s outbound links and for any that are ‘untitled’ and the the destination
path includes the ‘Sources’ container, finally we set a link type references.
So I think we can get the outcome you want, albeit via a method you didn’t envisage.
If so, then we’ll need to amend you document as it has no notes with outbound links that meet the criteria, Having at least one note meeting that criteria is essential for testing the solution. For instance we add a note “Note 4” with an untitled link to “Source 3”. This meets the criteria:
- a note with an outbound untitled link
- the link points to a note with `/Sources/ in its path (and thus the link’s destination path).
For proper testing, we also want a note with an untitled link that. Doesn’t point to a note in Sources
as we don’t want that to be changed as it only meets the criteria partially.
Edge case, if a note links to a source note by any link type other than “*untitled” or “reference” will not be affected by the above.