AS (Apple Script) app to add attributes to TBX

Love this. Here is a nice add on. Let’s say your want to get a list of all the attributes you use in a file. So that you can pull out a list of attribute:type pairs to add to @webline’s stamp above. Do this:

  1. Open your file
  2. Create this stamp
var vAttrList = document["user-attributes"];
$Text =;
$Text = "Number of user attributes: " + vAttrList.count + "\n";
vAttrList.each(anAttr){
   var vAttrKeys = attribute(anAttr)["type"];
	$Text = $Text+"\n"+ anAttr +":"+ vAttrKeys+ ";";
};
  1. Create a note, call it “MyAttributres” (the name does not matter)
  2. Apply the stamp in step 2 above to the note created in step 3.
    You’ll get something like this:

You can then manually go through the list and pull out the attributes you want to create in your standard stamp.

4 Likes