A stamp to put adornment's title in a Note variable

Dear TinderBox community,
I’ve been playing with TBX for a year (mainly academic writing using maps and outlines). Want now to automate some stuff.
My goal is simply to put research notes onto adornments (one adornment per author) and that each note inherits its adornment’s Title (so, gets its author).
I’ve managed to create an OnAdd that automatically does that for my new notes (works fine), but I also want to create a stamp for already-made notes.
I’ve created a note prototype with a $MyAuthor variable and I want this variable automatically populated with the adornment’s title: its action is “$MyAuthor=$Name(adornment)” —without quotes— (cannot paste screen dump, but I guess my post is pretty clear?). I’ve tried with “parent” instead of “adornment” without success… (also tried to right-click “evaluate” the variable).

What I’m doing wrong?
best and thanks!
Philippe

A stamp won’t do this, because stamps don’t bind the adornment designator in Tinderbox 8.

But your adornment’s OnAdd action will do the job; drag your note off the adornment and then back onto the adornment.

In Tinderbox 9, if the selected note lies on an adornment, the designator adornment will be bound to that adornment when evaluating a stamp.

1 Like

Thanks Mark, so I’ll wait for Tbx 9: dragging lots of notes back and forth won’t be so easy.
best,
ph

You don’t need to wait. Simple use the adornment’s OnAdd action:

$MyAuthor=$Name(adornment);

So, the adornment does the work, not the note, but to the same end.

dear Mark,
yep, you’re right (I’ve done that too), but I did that after writing lots of notes so I really can’t drop each bulk of notes back and forth for each adornment. I was just looking for a stamp that would do that afterwards. So, looking forward having Tbx 9.0 :wink:

1 Like

But if you read @eastgagte’s reply, the stamp will only populate the adornment designator (i.e. ‘bind’ to it) -if- the note being stamped is on the adornment, so you’d need to move the existing notes on to the adornment anyway.

Separately, if notes are already on the note and MyAuthor is not set, you can use this stamp on the adornment (not the notes on it):

var vNotes();
vNotes = collect(find(inside($Name(that))),$Path);
vNotes.each(aNote){
   $MyAuthor(aNote) = $MyAuthor;
};

I’m using a variable just so there is no litter to clear up. It’s a neater way of writing the following:

$MyList = collect(find(inside($Name(that))),$Path);
$MyList.each(aNote){
   $MyAuthor(aNote) = $MyAuthor;
};
$MyList=;

To explain:

  • First we make a list of all notes ‘on’ the adornment, using collect(). The `collect() operator’s first input is a designator.
    • as there’s no fixed named designator for this scenario, we use find(query) to make a designator on the fly. We leverage the fact that a note, wholly or partially, ‘on’ an adornment is treated as true by the inside() action query. Next we need to tell the code which adornment we mean.
    • as we want to use a generic stamp to use with any adornment, we pass inside() the title—$Name—of the being-stamped object. As we are referring to the object within a nested query we use the that designator. So: find(inside($Name(that))).
  • the second input parameter is the attribute to collect, here we collect the $Path of any notes matching the query.
  • new we cycle through that list, using the .each(){} operator, assigning ‘aNote’ as our in-loop variable for where we want to reference the source list value.
  • remembering the target of the stamp is the adornment, in turn we set the $MyAuthor for each aNote path to the adornment’s value of $MyAuthor.
  • If you are using a List attribute and not a variable, you’ll want to reset =; the attribute to avoid saving any now-unneeded data.

Joy! When I started exploring this I didn’t know if it could be done (and had several false starts) but it works and a bonus is if you needed to correct an author name (e.g. a typo or adding extra initials) you can just re-stamp the adornment(s) in question and all the notes on it will be updated to the new $MyAuthor value.

2 Likes

There are also some alternative approaches that you might want to consider. Have the author is one thing, but for academic writing having the citation and complete bibliography on hand is quite another. The can be extremely useful later down the write when you start writing, linked, and exporting. There are a ton of different approaches I’ve been playing with to make this process more and more efficient. In the end, the path you pick depends on your purpose, process, tools, and your individual style.

If you’d like to discuss this further, it would probably be easier initially over a call. DM me and let’s setup a zoom. Would be fun.

1 Like

It’s outstanding illustrations like this one that advance my familiarity and confidence in building snippets of action code for my own projects. Thanks so much for the detailed decode, @mwra !!

Wondering if there is interest or room for a unique post tag or forum topic/sub-board that gathers these kinds of breakdowns?
Edit: well I’m just going to create a separate Tbx project that contains the kinds of examples and explanations I need for my tasks :slight_smile:

Hey there, there actually is a thread we’re starting for just this purpose: Tutorials and Examples - Tinderbox Forum. I hope to build off of this.

1 Like

dear Mark,

thanks for your time and effort! Let me dive deeper in my setup because your proposition doesn’t work, I’m afraid:

My goal is to put research notes onto Adornments (one Adornment per author) and that each Note inherits its Adornment’s Title (so, gets its author for further referencing).
I’m reading a set of papers about a same theme and want to write a synthesis of those papers.

  • For each paper, I write its arguments in some notes in Map view, that I put onto a different adornment, which name is this of the author (i.e., Author(date)). I’ve opted for an Adornment instead of a Container because one can more easily read what’s inside Adornments in Map views.
  • My next goal is to add a metadata about the sub-theme of each note, then to collect them by a rule, then to reorganize the aliases in the outline mode to have a review outline. But I don’t want to lose the author of each note (to refer to it if needed). So, what is known is the Author in the Adornment’s DisplayName, what’s to be populated is the MyAuthor of each note, which is empty.
  • I’ve already written lots of notes, then I’ve created some lines of script (using Adornment’s OnAdd) that correctly put the Adornment’s DisplayName onto each MyAuthor’s note, but for each I’ve to put those notes out of the Adornment, then in, which is cumbersome and error-prone.
  • My goal was to write a Stamp that would do that, but I can’t because Stamps cannot get the Adorment’s Names, see @Eastgate’ answer above.

@mwra kindly devised a script for a stamp, which I’ve tested but it doesn’t work; my guess is that because

assumes that $MyAuthor is not empty, which it is. I’ve tried the reverse: $MyAuthor = $MyAuthor(aNote);
but it doesn’t work too.

Any thoughts?
best,
ph

Did you try amending the stamp to:

$MyAuthor(aNote) = $Name;

The answer was in this part of the description above:

Reading that and knowing, as I didn’t, that you wanted the the notes on the adornment to use adornment’s $Name as opposed to $MyAuthor as the source it should have have made clear why the stamp failed. However the fix is easy, as per the code above.

The quote above also explains why simply reversing the line of code, as you mentioned doesn’t work. Indeed, when first testing, I made exactly that mistake forgetting that the stamped object was the adornment rather than the notes upon it.

Pro Tips:

  • if the code doesn’t work, walk the code—what is each stage dong. If lost, ask here.
  • although it is neat to chain things together, I often do that last, and at first split the overall task into a series of discrete steps.
  • similarly with variables. I often start with using an actual attribute so I can see the result of each stage.
  • once I’m happy each stage produces the right info, I can then move to using variables and shortening the code (though in many cases there is no performance difference).
  • with growing experience, I can often skip these steps, but if I don’t get the desired outcome, I just re-apply the beak-down method above as it invariably flushes the miss-assumption I’ve made.

FWIW, if you like to keep different data in discrete attributes, you could stamp all your author adornments so their MyAuthor matches their tittle ($MyAuthor==$Name;) in which case my stamp above would work without modification. As ever with Tinderbox, there is more than one solution, and the we you pick is generally a matter of personal choice. :slight_smile:

dear Michael,
Thx for this alternate view; I prefer not to duplicate unnecessary data so the Author(date) info is sufficient to me, mainly because I don’t use the export facility: Tbx is, for the moment, only a place to process high-level ideas to refine in a more appropriate word processor (I’m more and more often using Multimarkdown Composer for its outline view).
I keep all my references stored in an EndNote file so it’s handy to retrieve any reference.
So far, no need to discuss it further (I’m just building the whole process), but it’ll be a pleasure to discuss with you when the work-flow will work! I’ll keep you informed!
best, and thanks,
ph

1 Like

Sounds good. Re the workflow, one thing I find very useful by having the other elements of a citations meta data in Tinderbox is that you can use this data to run queries and leverage different views, like Timeline. It is wonderful for digging deeper into the analysis and review of papers and author’s works, over time.