Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Redraw not working in pixel preview mode?

$
0
0

A recent update of Adobe Illustrator kinda broke my script.

 

My code:

 

$.setTimeout('redraw', Number(dialog._time.text));
// Extend ExtendScript's functionality:
$.setTimeout = function(name, time) {    // Pause the loop for `time`.    $.sleep(time); // Unfortunately this is a blocking function; there are not alternatives as of June 2015.    app[name](); // Call passed `Application` function by name string.
};

 

I use setTimeout to loop over layers in a document.

 

Up until recently this code was working in pixel preview mode.

 

Now, it appears that app.redraw() only works when not in pixel preview mode.

 

Can anyone confirm if app.redraw() works in pixel preview mode? Basically, I just want to show/hide one layer at a time using a specified pause time.

 

This also doesn't work when in pixel preview mode (code condensed for readability):

 

for (i = 0, il = doc.layers.length; i < il; i++) {    $.sleep(dialog._time.text);    app.redraw();
}

 

I really need this to work in pixel preview mode.

 

Oh, this does work:

 

$.setTimeout('redraw', Number(dialog._time.text));
alert('this alert makes the document refresh the view as the layers show/hide');

 

I'd love some assistance/feedback/advice/tips on this one.

 

Thanks!

Micky


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>