Sg2.9
Selected Segments remain "sel...
Recent RSS
Selected Segments remain "selected"
From:  Chris Deutsch
Date:  22. November 2009, 03:16

Hi!

The first check for selected segments in a path is correct. When checking the same path for selected segments again, you will get the same result, no matter what the actual selection.

Here's how to reproduce it. Create a button that calls the following function:

function selectedSegments(){
var selectedPaths = document.getItems(Path,{selected: true});
for(var i = 0; i < selectedPaths.length; i++){
for(var j = 0; j < selectedPaths[i].segments.length; j++){
print(j+") Selected: " + selectedPaths[i].segments[j].point.selected);
}
}
}

Draw a path with 3 anchors and select the first anchor point. Execute the script. The console will read:

0) Selected: true
1) Selected: false
2) Selected: false

Now select the last anchor and execute the script. The console will read exactly the same, stating that the first anchor is selected and no other. Select whichever anchors in that path and execute the script, the read will never change. Even closing the script and restarting it won't change it.

Any path you create will have the first read right, but no subsequent ones.

Is this a bug in Illustrator or Scriptographer? Is there any way to flush the variables, as a quick fix?

Thanks!

Re: Selected Segments remain "selected"
Date:  26. November 2009, 16:02

I looked into it and its a bug.. I'll post it to our bug tracking system and we'll get it fixed soon!

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Hexagonal Rasterizer 02.03.14