: How to wipe the active document clean at the beginning of a script? I want to have a blank slate at the start of my script. My two current approaches both have downsides. First, I create
I want to have a blank slate at the start of my script. My two current approaches both have downsides.
First, I create a new document at the start of the script. However, during development, I test run my script multiple times. Thus, I then have many open documents in Illustrator that I have to close by hand.
Second, 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?
More posts by @Fox8063795
1 Comments
Sorted by latest first Latest Oldest Best
For every pageItem do:
activeDocument.pageItems.removeAll();
This does not include swatches, symbols and other such persistent thing. As a alternative make a new document and close the old one.
activeDocument.close(SaveOptions.DONOTSAVECHANGES);
app.documents.add();
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.