-
1. Re: (CS3; JavaScript) how to efficiently "select all"/running an action
Patrice Brel Oct 3, 2009 10:36 AM (in response to Mike.Edel)Good evening,
Sub test_ai()
Set myAi = CreateObject("illustrator.application.CS4")
Set myDocAi = myAi.ActiveDocument'- - An idea is to show at first the layers on which you want to select all objects.
myDocAi.Layers("myLayerWithObjects").Visible = True
myDocAi.ActiveLayer.Locked = False
myDocAi.Layers("mySecondLayerWithObjects").Visible = True
myDocAi.ActiveLayer.Locked = False' - - - In a second time you select all
For Each myLayers In myDocAi.Layers
If myLayers.Visible = True Then myLayers.HasSelectedArtwork = True
Next' - - and finally you define a variable with your selection
myselexion = myAi.Selection
End Sub
After that you will probably have to identify each object of your selection.
Best regards
Patrice
-
2. Re: (CS3; JavaScript) how to efficiently "select all"/running an action
Mike.Edel Oct 8, 2009 7:15 AM (in response to Patrice Brel)Hi Patrice,
nice one - I wasn't aware that setting the "HasSelectedArtwork" property to true would select all objects on the layer.
So far I always had to loop through the objects and set their selected property to true.
Thanks,
Mike

