Tinderbox Forum

How can I programmatically do what the "reset" button in "Edit Displayed Attributes..." does?

Hi - the subject says it all, really. I have a container with >300 notes. They all have the same structure (I imported them), but I cleaned it up a little by copying one, editing it and saving it as a prototype.
When I assign that prototype to the notes, they don’t change - I need to press the “reset” button in the “Edit Displayed Attributes…” popover.
How can I find a programmatic solution so I don’t need to do that manually to all >300 notes? I know it has to do with inheritance, and I read up on it, but didn’t find a solution. If there is none, I’ll do it manually, but I though I’d rather ask here to be sure…
Many thanks in advance for any help!

Wrong question. I mistook Displayed Attributes to $Text. Answer further below.

This a known feature request, and I don’t think there is an answer as yet. In part this is down the the inconsistencies of individual conception of reset (for the developer, if my and your conceptions differ, who is ‘right’? What to do?).

Part of the complexity is added , ISTM in the way ‘style’ is applied. To fully reset a note, I believe, oit is necessary to do two tasks:

  • first select all $Text (or you get different outcome form that you likely want).
    • menu FormatStyleStandard Font ( ⌃+⌥+⌘+T)
    • menu FormatStyleReset Margins. No shortcut!

Having done that more than once to doc with thousands of notes, I truly feel the pain, of the lack of such a reset. But, I also respect the problem posed .

But, once you want to—for instance—rest the fonts but not highlights, you need a far more nuanced control.

Style ruler are for me a retrograde step. Having (no obvious) per-paragraph styling bites me all the time, noting the need to use both Standard Font and Reset Margins to properly flush all not inherited settings. If I need this sort of typesetting, I can think of better places to do it; for me, in Tinderbox it simply gets in the way. But, I’m sure the lovers of styled text will think otherwise.

†. I never tried, but I do wonder it deleting all the the TBX’s <rtfd> tag data (i.e. the stored styled version) of text in a text editor—i.e. outside Tinderbox in something like BBEdit—might be a quicker fix. On opening I assume Tinderbox would rebuild the dat but with a lack of past data it would use the data in the <text> tag (i.e. the un-styled version of $Text) to start over thus being forced to build un-styled text beyond any inherited (doc or prototype) values.

Many thanks, Mark! Since the notes concerned only have attributes (no $Text in them), I am not sure your suggested steps help in my case.
I am far too timid to experiment with loading my file into BBEdit and doing something to its XML innards. So I’ll rather wait for some webinar that does not require my undivided attention and go through the (not very demanding) manual correction, I guess…

Understood. This is why a selection-level styling kill-switch would be a boon. If, as a user, I am over eager, well there are back-ups for that.

May you find a long but not-that-interesting webinar soon! :slight_smile:

2 Likes

When I experience this I take care of it in in two steps.

  1. Create a stamp:
    $Prototype=“pXXXX”;
    $DisplayedAttributes="";
    This will set/reset the note to the desired prototype and then reset the inheritance.
    I test this on one or two notes to make sure I’m getting what I expect.

  2. Select and apply the stamp to all relevant notes.

1 Like

Duh, I’ mixed $Test and $DisplayedAttributes. Re-setting the latter is much simpler. All notes inherit $DisplayedAttributes. The default is “” (i.e. nothing).

So, as @satikusala rightly advised test (and save a copy first before a mass change. Then use a stamp, or an agent that finds all non prototype notes and reset $DisplayedAttributes using the action:

$DisplayedAttributes=;

Now all notes will use a default or prototype-inherited value for Displayed Attributes.

@satikusala and @mwra, many thanks for your help - and combined it solved my problem! Michael, your stamp works perfectly, but I need to use Mark’s version of $DisplayedAttributes=; if I want to only reset, not delete the existing content of the attributes. Great! I hope others seeking a solution will find this in the forum. And I will add it to my “Tinderbox Tricks” file.