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

visibility variable get lost on undo/redo.

$
0
0

Hello All,

 

I've scenario where I've to distinct the page items and apply some sort of unique Ids to them. So for that, I added the visibilityVariable to the page items. Code is as follows,


var idoc = app.activeDocument; 

var ipath = app.selection[0];

var idocvar = idoc.variables.add();

idocvar.kind = VariableKind.VISIBILITY; 

idocvar.name = "0001"

ipath.visibilityVariable = idocvar;

 

Everything work fines untill I used undo/redo. The visibility variable got lost on undo/redo.

 

Following are the steps that I do,
- Create a pageItem, let's say a rectangle, and select it.

- Now run the script.

- You can see in the Variables palette that variable is assigned to the object.

- Now move the page item (2-3 times) from one position to another.

- Now Undo/Redo by usnig cntrl-z and cntl-shift-z. Object get lost and there will be no variable attached to the pageItem.

 

Am I missing something here? Do we have another way to distinct the pageItems apart from visiblityVariable which will work in undo/redo case?
Thanks for any help..


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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