Stamp to add a couple of attributes - HowTo?

Can a stamp be used to add attributes?
For example, to add the tags $URL and $Tags, how would the Action (code) of a stamp look like?

(I realize this can easily be done using a $Prototype, but I’d like to know what other ways exist to easily add a couple of Tags. I’ve also found @webline’s post on how you could do it using AppleScript, but for the time being would prefer to stay within Tinderbox.)

Thanks for helping out!

Add where. I suspect you’re referring to a note’s Displayed Attributes table, or are you trying to add a new (user) attribute to the document … or something else?

Tips:

  • What are Displayed Attributes?
  • The list of a note’s Displayed Attributes are stored in a List-type attribute: DisplayedAttributes.
  • If using prototypes, consider altering the $DisplayedAttributes of the prototype not the note using the prototype.
1 Like

My bad, you are correct, I mean the Displayed Attributes table.
I have been looking at $DisplayedAttributes.

So I was thinking of a Stamp with some correctly written code to do something like
$DisplayedAttributes=$URL&$Tags

The correct code would be:

$DisplayedAttributes="URL;Tags";

assuming you want the displayed attributes to be just these two. If you wanted a stamp to add URL to whatever the current displayed attributes were, you might write

$DisplayedAttributes=$DisplayedAttributes+"URL"
1 Like

Thanks Mark!
I was close but not close enough..
Was trying to use “$URL”&”$Tags”; but that would not work.

Thanks for helping out, even with something so basic and simple!

Recall the ‘&’ is a query- joining operator in action code. Here you are quitting an action and not a query.

Using current action code, you might also use:

$DisplayedAttributes += [URL;Tags];

The '+=’ increment operator replaces:

$SomeList = $SomeList + "new list item";

with the functionally similar:

$SomeList += "new list item";

to give a shorter, more readable form.

The [ ] is the new declarative form for list data (List or Set types), see List-type Attributes for more explanation of the [ ] style of declaring list data (new syntax added in v9.5.2).

1 Like

‘&’ means “logical and”
‘+’ in this context means “list addition”

1 Like