Tinderbox Forum

Create attribute with action code

I searched and found no answer: is it possible to create user attributes with action code? And can I test if an attribute is already there?

Not yet, though you can create them from a script, which you can invoke from an action.

Do you have an example of this script?

just a quick reply: with AppleScript you have the “make” command to create a new attribute.

This should work (not tested!)

tell application "Tinderbox 9"
	tell its document "testCreateAttribute"
		set myNote to note named "Demo"
		make new attribute with properties {name:"demo"}
		set value of attribute named "demo" of myNote to "here I am"
	end tell
end tell
2 Likes

P.S.: tested - worked :wink:

2 Likes