drummerSupport
drummerSupport copied to clipboard
detweet script
I had an outline of a thread of tweets, and wanted to take off all the attributes of about 10 nodes that had to do with it being a tweet. Basically I wanted each item to be left with one attribute -- created. Here's the script.
op.go (up, infinity);
while (true) {
let created = op.attributes.getOne ("created");
op.attributes.makeEmpty ();
op.attributes.setOne ("created", created);
if (!op.go (down, 1)) {
break;
}
}
BTW, DocServer is an essential tool. You'll find a link to it in the Docs menu.
For example, here's a link to op.attributes.setOne.
http://scripting.com/code/docserver/?verb=op.attributes.setOne