drummerSupport icon indicating copy to clipboard operation
drummerSupport copied to clipboard

detweet script

Open scripting opened this issue 4 years ago • 1 comments

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;
		}
	}

scripting avatar Jul 11 '21 03:07 scripting

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

scripting avatar Jul 11 '21 03:07 scripting