scripting-for-illustrator-tutorial icon indicating copy to clipboard operation
scripting-for-illustrator-tutorial copied to clipboard

How to clean up all elements of a document in the start of a script?

Open anhqle opened this issue 8 years ago • 1 comments

I test run the script in development multiple times. If I create a new document at the start of every script, it will lead to many open document in Illustrator very quickly.

If I choose the active document at the start of the script instead, it does not open new documents but it will write on top of whatever is already there.

Is there a way to select the active document but wipe it clean in the beginning of the script?

anhqle avatar May 11 '16 00:05 anhqle

Remove all items is something like this:

var doc = app.activeDocument;
doc.pageItems.removeAll();

ff6347 avatar May 11 '16 04:05 ff6347