Copy link to clipboard
Copied
I can not reproduce the error with smaller scripts, so size must be the culprit.
It generates a whole year calendar. After that, I try to make several copies of it for printing on the page.
app.activeWindow.select(myTextFrame);
app.copy();
app.paste();
myDocument.selection[0].move([x,y]);It works ok only if I use the already created active document.
Otherwise, it doesn't show created new document until the end, switches to the new document, throws "UXP Script Error No.1" and after "OK" It first shows the selected empty frame and then fills it with the calendar.
In the existing document, it also shows two empty frames and then fills them with calendars, but it doesn't throw an error and basically works.
I tried
app.waitForAllTasks();But it didn't help. I also tried setTimeout(), but it doesn't look like setTimeout() works at all.
Is there any other way to pause or switch focus to a new document? And what Error No.1 means?
Using copy/paste was already a bad idea with ExtendScript. It's likely it's a bad idea with uxp as well 😉
use duplicate instead
myItem.duplicate().move()
hth
loic
Copy link to clipboard
Copied
Using copy/paste was already a bad idea with ExtendScript. It's likely it's a bad idea with uxp as well 😉
use duplicate instead
myItem.duplicate().move()
hth
loic
Copy link to clipboard
Copied
Awesome!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more