ExtendScript: redraw() alternative?

Explorer ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Is there an alternative to redraw() that does the same thing but doesn't add to the number of undos. This command is great but if (just for arguement's sake) you have to run it in a for loop 10 times, then the user will have to undo 10 times to back to the state before script execution. Completely insane.

 

There are cases where I need to use something like redraw() to force a script to update and realize that there are a different number of objects in the selection object than it currently incorrectly thinks. In fact I already found a ridiculous solution where I just set a position of something to itself and for whatever reason this makes selection update to the correct list of objects, all without adding to the undo amount:

selection[0].position = [selection[0].position[0], selection[0].position[1]]

 

Surely there must be a better way?

TOPICS
Scripting

Views

64

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation