Note that there are some explanatory texts on larger screens.

plurals
  1. POselect / cut / pasteInto when window not visible
    primarykey
    data
    text
    <p>I'm working on a script where I take a business card design and use it to generate a sheet of paper that has ten cards on it to match a template to print temporary cards. The tricky part here is the bleeds; they'll overlap down the middle so I need to make clipping masks for each one.</p> <p>I came up with a system where I made the frames that would become the clipping masks, duplicated and moved the cards where they need to go, and then more or less did the following:</p> <pre><code>dupCard[i].select(); app.cut(); frameGroupFront[i].select(); app.pasteInto(); </code></pre> <p>This works great. But because it's a little resource-intensive, I tried to hide the working file upon creation and use workingFile.windows.add(); at the end as I've done in the past. But when there's no window, select() doesn't work! I get error 90886 stating that "No document windows are open."</p> <p>How can I select the items I want so that I can cut and paste it without having a visible window? If not possible, is there an alternate solution to the problem?</p> <h3>EDIT:</h3> <p>I was asked to provide a scripting sample, so here's the most basic sample I can furnish:</p> <pre><code>var newPage = app.documents.add(); var myRectangle = newPage.rectangles.add({geometricBounds:[1, 1, 5, 5]}); var myRectangle2 = newPage.rectangles.add({geometricBounds:[1, 1, 3, 3]}); myRectangle.select(); app.cut(); myRectangle2.select(); app.pasteInto(); </code></pre> <p>This script works. But, take the first line and do app.documents.add(false) instead, and it doesn't work because no document window is open. In this example, I'd like to be able to get the one rectangle inside the other with no window visible.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload