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?