If I wanted to remove links from a note, how would I go bout that? For example, If I wanted all links from 2011 to be deleted. I tried unlinkToOriginal(), but I appear to be doing something wrong.
Select the note. Open the Roadmap from the View menu or contextual menu. Select the link to destroy. Press Delete. (The Browse Links popover also can be used for this.)
This is a destructive action that cannot be undone.
Hi there, yes, this is a good idea and works for one link at a time. I guess I should have been clearer with my question. How do I programmatically unlink many links, e.g. 20 or more, to or form a note? Doing 20 or more not 20 more notes is a lot one at a time. Iād like to find a way to automate this a bit. I figured it out how to do it with a Stamp, but not an agent. I guess I have to figure out the context, think about the action from Tinderboxās view. That will help.
Iāve tested
unlinkFrom(all,"[type]");
and it works for a selected note. So an agent that queries for the notes you want to affect should work with that sort of action. You might need to cycle through all link types in use. But, in an agent use
unlinkFromOriginal(all,"[type]");
The action means āunlink this note for links of type ā[type]ā for all notes that link to itā.
I suspect your case is probably messier than than posts indicate, so this is not guaranteed to solve your problem. As @mwra suggests, these are the right action codes ā itās now a matter of the right agent.
Cool, thanks for your help, guys. Ya per the stamp visual above I have been trying the unlinkTo and from, but clearly, Iām not getting the context right in the agent. I got it working at the step level. Iāll playing around with other options. Eventually, Iāll figure it out.
Ok, I give up. Here is my fine. TBXUC - Rendering Spreadsheet.tbx (847.4 KB) What Iām trying to do is have āaUnSectorā remove all the inbound links to the note ānodeā government. I know I can do this one by one and with a stamp, but canāt seem to get the agent to work.
Your file has a link type with no name ā check the links inspector ā and most of the inbound links for āgovernmentā have that link type. The file also seems to be corrupt ā when I try to apply an unLink
stamp, or agent, Tinderbox crashes on me.
when I try to apply an
unLink
stamp, or agent, Tinderbox crashes on me.
If you have a minute. it would be useful to see the document and the crash log.
OK. I opened that document. The stamp named āCapitalizeā has the action:
unlinkTo(āgovernmentā)
In outline view, I selected the note āMassachusetts Governmentā, which is linked to āgovernmentā, and then used the stamp āCapitalizeā. The link was deleted, and Tinderbox didnāt crash.
I sent you the crash logs. Makes no difference to me if the crashes can be reproduced.
Of course not, but in this case ā as so often! ā the crash log contains a vital clue. The crash occurs during map drawing, and so we know that you were in map view, while I was working in outline view.
The difficultly likely arises when an action deletes a link while the map view is drawing the link. Clearly, that can be tricky! In any case, I know where to look.
As noted above, unlinking with the Stamp works fine. What Iād like to know is how/if this can be done through an agent. Thanks.
The same action should work in an agent. As explained above, this in an agent is bound to the alias the agent is making, so you want to unlink the original.
Thanks. Iāll keep playing and try to figure something out.
@satikusala: I think I have a solution. I wasnāt paying attention to the description of unlinkFrom().
unlinkFrom(["item|group"][,"linkType"])
in particular this:
linkType (string). Optionally, link deletion can be constrained to one or more types supplied in linkType . The argument allows simple regular expressions; ādisagree|exampleā would delete links of type ādisagreeā and āexampleā but leave others untouched.
So, when I try this in a stamp (would work in an agent)
unlinkFrom(all,"*");
It works ā because "*"
is a regular expression that captures all link types.
Sorry for not paying attention earlier ā in Tinderbox it is the simplest, most obvious errors that are the hardest to find.
(And to confirm again several times today, unlinkFrom()
or ```unlinkTo()``,` when used on a map, kills Tinderbox.)
Thanks, Paul. I like the refined stamp, and stamps certainly work. I love the animated gif idea. SUPER SMART!
Unfortunately, I still canāt seem to get this to work with an agent. Here is a LONG animated gif that shows that the stamp works but the agent does not seem to work. Any chance in your sample file you can try an agent to see if you can get it to work.
Stamp works:
The agent does not seem to work (Iāve tried To and From)
I tested and this agent works for me:
Note that in an agent you need to use unlinkFromOriginal
, and in the syntax unlinkFromOriginal(["item|group"][,"linkType"])
you can leave the first argument (āitem|groupā) blank since the scope is already determined by the agent.
Thanks. Still no joy. Iāll figure it out eventually.