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

illustrator selecting layers by name then "make mask" command

$
0
0

Hi guys,

I'm trying to get a vbscript to do this maybe easy task for some of you

 

I want to select 2 layers by name and then set the command :

 

NameA = "nomdeCalqueA"

NameB = "nomdeCalqueB"

Set appRef = CreateObject("Illustrator.Application")

        Set idoc = appRef.ActiveDocument

        appRef.activeDocument.Selection = Empty

     

    For Each targetDocument In appRef.Documents

        countOfLayers = targetDocument.Layers.Count

        For layerIndex = countOfLayers To 1 Step -1

            Set targetLayer = targetDocument.Layers(layerIndex)

 

                layerName = targetLayer.Name

 

                    If (InStr(layerName, NameA) = 1) Then

                    'then select my layer

 

 

                    End If

                    If (InStr(layerName, NameB) = 1) Then

                    'then select my layer

 

 

                    End If

 

Next

Next

     

        appRef.executeMenuCommand ("makeMask")

 

 

 

I'm a little lost...

 

Thank you for helping.

Nems.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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