Illustrator selecting layers by name then "make mask" command

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.

iDoc.Layers("Name") in VB.NET ...  try it for VBS or possibly iDoc.Layers.Item("Name").
Again -- just remember you're masking elements, not layers.
Since you're more comfortable with VB maybe this could help, albeit it VB.NET. Translation should be pretty easy for you though. Note: I just pop in GUIDs to temporarily name the groups. You can use a different naming convention.
Dim aDoc As Document = app.ActiveDocument
aDoc.Selection = False
Dim grp1 = CreateGroup(aDoc, "Layer 4")   'whatever layer name you want
app.ExecuteMenuCommand("compoundPath")
Dim grp2 = CreateGroup(aDoc, "Layer 2")   'whatever layer name you want
app.ExecuteMenuCommand("makeMask")
Private Function CreateGroup(aDoc As Document, layerName As String)
    Dim tmpGuid = Guid.NewGuid.ToString
    Dim layer As Layer = aDoc.Layers(layerName)
    Dim grp = layer.GroupItems.Add : grp.Name = tmpGuid
    For i = layer.PageItems.Count To 1 Step -1
        Dim pi = layer.PageItems(i)
        If Not pi.Name = tmpGuid Then pi.Move(layer.PageItems(tmpGuid), AiElementPlacement.aiPlaceInside)
    Next
    layer.PageItems(tmpGuid).Selected = True
    Return layer.PageItems(tmpGuid)
End Function

Similar Messages

  • [CS3][JS] Selecting Layers by Name

    I'm trying to design a script to select layers by a given name. And then PDF layer1 (base) and certain items that are on each layer 1 at a time so I have multiple different pages. But the PDF thing doesn't seem to be much of an issue. I just can't select the layer by name.
    This is what I have so far:
    var myDocument = app.documents[0];
    var circusLayer = myDocument.layer[Circus];
    circusLayer.visible = false;
    Thanks!

    Hi Chris:
    var circusLayer = myDocument.layers.item("Circus");
    Thanks,
    Ole

  • Replace layer names in selected layers only

    I am using this script to find and replace words in layers. (The script only targets particualr words, rather than the whole layer name).
    I would like to make it so it targets selected layers only.
    I have found this script which loops through selected layers only, but I am not sure how to add the find and replace layer name functioality.
    Thanks for any help that can be offered.

    big_smile wrote:
    Looking through the guide, it doesn't seem "hasSelectedArtwork", is a built in function either. Are there any tutorials or guides that explain how to target selected layers?
    Wrong reference manual, see this one:
    http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/illustrator/scripting/cs6/Illustrator -Scripting-Reference-JavaScript.pdf
    Page 91 -- CHAPTER 1: JavaScript Object Reference
    Layer
    Property
    hasSelectedArtwork
    Value type
    boolean
    What it is
    If true, an object in this layer has been selected; set to false to deselect all objects in the layer.
    So as I talked about here:
    W_J_T wrote:
    Correct. Yeah there is no direct way unfortunately (like many things via scripting), thats why I suggested using "hasSelectedArtwork", that would work if you select the layer target when selecting your desired layers to rename.
    and...
    W_J_T wrote:
    if(layerReferenceString.hasSelectedArtwork == true){
         // relative code
    That would offer a way to know if a layer is selected or not.
    As far as I know that is the only round about way of knowing if a layer is selected via scripting.

  • I have manipulated a photo using layers etc and then flattened it and saved it under a new name.  When I use 'Preview' (mac) to view the finished photo it doesn't look right.  It's as the layers have not flattened correctly.  When viewed in Elements 12 it

    I have manipulated a photo using layers etc and then flattened it and saved it under a new name.  When I use 'Preview' (mac) to view the finished photo it doesn't look right.  It's as the layers have not flattened correctly.  When viewed in Elements 12 it looks OK.  The photo looks incorrect in other software such as photo books.
    Looking at the same photo before flattening, what is being shown is only the top layer.
    How do I correct this?

    STEVEN1A wrote:
    I have manipulated a photo using layers etc and then flattened it and saved it under a new name.  When I use 'Preview' (mac) to view the finished photo it doesn't look right.  It's as the layers have not flattened correctly.  When viewed in Elements 12 it looks OK.  The photo looks incorrect in other software such as photo books.
    Looking at the same photo before flattening, what is being shown is only the top layer.
    How do I correct this?
    The top layer is indeed the one that is visible, unless there is/are area(s) of translucency on that layer, so that you can visualize a portion of the subjacent layer.
      the finished photo it doesn't look right.  It's as the layers have not flattened correctly. 
    Are your settings targeted to have the printer manage colors, or, to have PSE manage colors?

  • TS2755 When I iMessage, I type in my friends name, then select her cell number that is in my contacts.  When I start the iMessage, her husband's name shows up as the default name for who I am messaging.  How do I change it so that her name shows up?

    When I iMessage, I type in my friend's name, then select her cell number from my contacts.  When I start the iMessage, her husband's name automatically fills in as the default name.  My friend is getting the iMessage, but this is confusing to me, the sender.  I want her name to automatically be the default when I select her cell number.  How do I change this? Using the 3rd generation iPad with retina display.

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • How to make the selection screen field names to apper as in logon language

    hai
    the selection screen field names should appear
    as that of logon language
    and <u>before that once i logon with a language
    it should pop up the (some)message in the logon language</u>.
    For the selection screen filednames to appear as that
    of the logon language whether i have to maintain the textelements for all screen fields in all possible languages or i have to write only in english and tell mentioning it to change

    In <b>SE38</b> --> Goto --> Translate.
    Choose target language, and start making the translation -;)
    Greetings,
    Blag.

  • How Can You Bring Illustrator Cs5 Layers into Photoshop Cs5?

    Hi everyone, Is it possible to bring Illustrator artwork into Photoshop so that the layers in Illustrator are layers in Photoshop, and so that all the content is arranged as it was in Illustrator.
    What I have been doing is bringing in a shape or a group of shapes into Photoshop by pasting them into a layer in PS then bringing in some more stuff from another layer in Illustrator and pasting that into another layer in PS but obviously it's a mission to line up the contents again so it is arranged like it was in Illustrator in the first place.
    Any help appreciated
    thanks Gareth

    No, it doesn't say how to do it there
    Well, then you probably haven't read carefully enough about what can be set up when exporting as .psd in Illustrator.
    When you export as .psd there are several export options about preserving layers. As mentioned, there are some restrictions.
    But tell me, what is unclear about the following quote?
    Write Layers
    Exports groups, compound shapes, nested layers, and slices as separate, editable Photoshop layers. Nested layers that are more than five levels deep are merged into a single Photoshop layer. Select Maximum Editability to export transparent objects (that is, objects with an opacity mask, a constant opacity less than 100%, or a blending mode other than Normal) as live, editable Photoshop layers.
    Preserve Text Editability
    Exports horizontal and vertical point type in layers (including nested layers up to five levels deep) to editable Photoshop type. If doing so compromises the appearance of the artwork, you can deselect this option to rasterize the text instead.
    Maximum Editability
    Writes each top-level sublayer to a separate Photoshop layer if doing so doesn’t compromise the appearance of the artwork. Top-level layers become Photoshop layer sets. Transparent objects remain editable transparent objects. Also creates a Photoshop shape layer for each compound shape in a top‑level layer if doing so doesn’t compromise the appearance of the artwork. To write compound shapes with solid strokes, change the Join type to Round. Whether or not you select this option, all layers over 5 levels deep are merged into a single Photoshop layer.

  • Is there a way to select MULTIPLE tabs and then copy ALL of the the URLs and titles/or URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; However, I prefer to use a Firefox feature rather than download an add on. Thanks.

    Currently, I can copy ONE tab's url and nothing else (not its name). Or I can bookmark all tabs that are open. However, I'd like to have the ability to select multiple tabs and then copy ALL of the the URLs AND their titles/or copy ALL of the URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; when I download the add on, I get a message saying that using the add on will disable Firefox's tab features. I prefer to use Firefox features rather than download and use an add on. Is there a way to do this without an add on?

    Hi LRagsdale517,
    You should definitely be able to upload multiple files by Shift-clicking or Ctrl-clicking the files you want to upload. Just to make sure you don't have an old version of the service cached, please clear the browser cache and then log in to https://cloud.acrobat.com/files. After clicking the File Upload icon in the upper-right corner, you should be able so select multiple files for upload.
    Please let us know how it goes.
    Best,
    Sara

  • Batch rename selected layers

    I'm trying to find a script that can help batch rename/renumber a group of selected layers.
    So far I've been able to find a script that renames every single layer in a Photoshop document (overkill). Or there's the CS6 Tab rename trick (too slow).
    I routintely export PSDs from Illustrator for use in After Effects. But in Photoshop, I'll get a couple hundred layers named <path> or <path> + <path> or <group>. Renaming by hand is out of the question. But I don't want to rename every layer the same.
    Any suggestions?

    I wrote one for you here...
    http://www.retouchpro.com/forums/photoshop-scripting/23234-script-find-replace-text-layer- names.html

  • Change Color Selecting Layers in PSE10 for a Drawing from Photoshop CS6 (non-photo) .PSD file?

    Hi Everyone,
    I have a drawing that was created in Photoshop CS6 (non-photo) and saved as a .PSD file.  I am able to open the file in PSE10 and see the drawing and select the layers.  I am having trouble with figuring out how to change the colors on each layer in PSE10.  When I select a layer where do I go to change the color of that layer?  Can this be done in PSE10 as this a drawing created in Photoshop CS6 and not a photo?
    TIA,
    ClearInk8

    I'm not sure what I am doing wrong. 
    Here are the steps I have tried.
    I made sure the RGB Color (Image>Mode) was selected.
    I selected the star layer
    Next I selected Layer>Created Clipping Mask
    Then I selected Color blend mode
    Then I selected Solid Color
    When I choose a color the entire canvas fills with the solid color and covers up the drawing.
    What step am I missing?
    The small red square outline you have next to the orange color box in the color fill layer I am not see this small icon.
    ClearInk8

  • Is there a way to move everything forward when you stretch select layers?

    Hi,
    I have a comp with multiple animations happening.
    At some places in the comp I want to make layers appear longer.
    When I select these and stretch them - the remaining layers need to move forward in time to compensate.
    This doesnt happen and so the stretched layers over lap with upcoming (in the time line) layers.
    Is there a way to do this?
    Thanks in advance
    Kal

    You can command-select the layers you want to move and drag them forward or backward in time. It's easy. There is no way that I know of to do this automatically if you stretch a layer. AE does not have insert-and-ripple capabilities like a video editor does.
    Place or move a layer in time
    The layer duration bar represents the layer duration visually. The In, Out, and Duration columns in the Timeline panel represent the layer duration numerically.
    Note:
    To choose which columns are visible in the Timeline panel, choose Columns from the panel menu, or right-click (Windows) or Control-click (Mac OS) a column heading.
    These procedures move the entire layer in time.
    To set the In point or Out point numerically, click the number in the In or Out column for the layer in the Timeline panel.
    To move the In point or Out point to the current time, Alt-click (Windows) or Option-click (Mac OS) the number in the In or Out column for the layer in the Timeline panel.
    To move the In points of selected layers to the beginning of the composition, press Alt+Home (Windows) or Option+Home (Mac OS).
    To move the Out points of selected layers to the end of the composition, press Alt+End (Windows) or Option+End (Mac OS).
    To move selected layers one frame later, press Alt+Page Down (Windows) or Option+Page Down (Mac OS). To move selected layers 10 frames later, press Alt+Shift+Page Down (Windows) or Option+Shift+Page Down (Mac OS).
    To move selected layers one frame earlier, press Alt+Page Up (Windows) or Option+Page Up (Mac OS). To move selected layers 10 frames earlier, press Alt+Shift+Page Up (Windows) or Option+Shift+Page Up (Mac OS).
    To move the entire layer in time by dragging, drag the layer duration bar to the left or right. To snap the layer duration bar to significant points in time (such as markers, or the start or end of the composition), Shift-drag the layer duration bar.
    Note:
    When you drag a layer in the Timeline panel, the Info panel displays the name, duration, change in time, and In and Out points for the layer. 
    Before and after dragging the duration bar 
    Jeff Almasol provides a script on his redefinery website with which you can move selected layers as a group, aligning the group to a specific time in the composition.
    To the top 

  • Layers feature and a layer mask pen tool

    Could we see a simple Layers feature and a layer mask pen tool - so that we don't have to go to photoshop for simple cutout etc.

    Theres some basic stuff you are not understanding…
    1. In Photoshop there is the pen tool for creating abstract vector edges, and selection tools (lasso, magic wand etc). You need to turn the results of the pen tool into a selection. Best way is using the the Command/return shortcut, or command clicking on the path in the paths panel.
    2 layers need to be , not - If you want to delete areas (make them transparent). To do this either go to Layer/New/Layer from background - or hold Option and double click the Background layer.
    3 See answer 2, and use Free Transform (command T)

  • Select layer by name.

    I need to be able to select a specific layer by name to make active. I cannot find any documentation.
    The layer name is always "PDF (Replace Contents...)" - then I'll replace the content with a specified  PDF (constant - naming convention also).
    -kp

    Search on getbyname in the scripting guides you will find documentation like this
    The collections, as in this example, can be treated as arrays, which is useful for iteration. They also provide
    methods to create their contained objects, and to access them by name:
    var newLayer = activeDocument.artLayers.add(); // Create a new ArtLayer object
    newLayer.name = "My Layer"; // name it for later reference
    var layerRef = activeDocument.artLayers.getByName("My Layer");
    so you would code somethinf like this
    try { var layerRef = activeDocument.artLayers.getByName("PDF");}
    catch(e){
                        alert("Document does not have the Required PDF layer");
                        var abort = true

  • Ive been trying for hours now but illustrator wont allow me to create clipping mask

    I have created the attached logo wit the pen tool. I then cut the middle bit out using the shape builder tool.
    I imported this onto a new document containing an image/object i want to clip it to . I select both go to object> make clipping mask.
    Both objects suddenly go blank and i can see the no fill/ no stroke icons. If this doesnt happen then ai will plain and simply say "cannot make clipping mask".
    This has been bothering me for a couple days now.
    Anyone have any ideas?
    Thanks in advance.

    herms-ra.
    You can do it in a quite different/similar way with Cliping masks, without or with the purple/flamelike/smoky coloured background.
    Note: There was an error in the first suggestion in post #18: In Step 5) you should select C) (the purple/flamelike/smoky coloured background to cut from) instead of D) (the underlying texture of the dripping black parts), sorry, I just spotted it.
    You may (reusing part of the first suggestion):
    1) Go back to, or start anew with, the following basic parts (starting with this stacking order):
    A) The Compound Path forming the inner dripping black part (in the A),
    B) The Compound Path forming the outer dripping black parts,
    C) The purple/flamelike/smoky coloured background to cut from,
    D) The underlying texture of the dripping black parts,
    E) The underlying texture of the inner letter parts;
    2) Select A) and B) and copy them both at the very top of the stacking order, then release both Compound Paths and delete the inner path from A) and the outer path from B), then make them into a new Compound Path consisting of the inner letter shapes (you may use Pathfinder>Minus Front or Object>Compound Path>Make);
    3) Move E) (the underlying texture of the inner letter parts) up just below the new Compound Path from 2), select both, and Object>Clipping Mask>Make, then hide;
    4) Select A) (the Compound Path forming the inner dripping black part (in the A)) and B) (the Compound Path forming the outer dripping black parts) and Object>Compound Path>Make;
    5) Select the combination from 4) and D) (the underlying texture of the dripping black parts) and Object>Clipping Mask>Make;
    6) Show 3).
    C) The purple/flamelike/smoky coloured backgroun, if you keep it, or any other background will will be visible wherever it is not covered.

  • Init Select for Field name

    Hi all ,
    While i am trying to run initdelta i am getting error message "init select for field name Currently running in  request REQ_jijhoieoililh" how to resolve.
    i am unable to fill setup tables for plant maintinence datasource 2li_17_I3HDR i am not finding option in SBIW.
    Also i am getting Error "No Successful initialisation of the delta update took place " how to do that i did in
    infopackage but but still getting this error.
    thanks in advance--

    Hello Srinivas,
    in the transaction LBWE, in the plant maintainance applcation, in the update column for MC17I30HDR, make it active.
    then proceed with filling the setup tables.
    also
    take a look Roberto's weblog
    /people/sap.user72/blog/2004/12/16/logistic-cockpit-delta-mechanism--episode-one-v3-update-the-145serializer146
    /people/sap.user72/blog/2004/12/23/logistic-cockpit-delta-mechanism--episode-two-v3-update-when-some-problems-can-occur
    /people/sap.user72/blog/2005/01/19/logistic-cockpit-delta-mechanism--episode-three-the-new-update-methods
    /people/sap.user72/blog/2005/02/14/logistic-cockpit--when-you-need-more--first-option-enhance-it
    /people/sap.user72/blog/2005/04/19/logistic-cockpit-a-new-deal-overshadowed-by-the-old-fashioned-lis
    Hope this helps..
    thanks,

Maybe you are looking for

  • Video Stream from Webcam with socket possible?

    Hello there, i want to stream a live feed from my webcam in a chat, but i have no idea how to manage it... ( i dont want RTP ) ... I can allready display it on my screen, but how do i stream this ? Can i create a Socketstream from this ? And how can

  • How to delete large data using XML batch in chunk

    public void DeleteListItems(SPWeb web, SPList list) RMPExceptionManager.LogErrorInFile("--------Delete List Items from : " + list + " starts--------", true); try web.AllowUnsafeUpdates = true; StringBuilder builder = new StringBuilder(); builder.Appe

  • Hyperion Planning: Reporting tools

    Hi! I am using Hyperion Planning and I want to know which reporting tools I could use. I know Smart View but there are other options? Thanks!

  • LinkToAction in Table Header ?

    hi experts! Please tell me how we can change Table Header (Caption) to LinkToAction ? thanks in advance nikhiL

  • Is java 100% pure object oriented?

    I am very confuse is java 100% pure object oriented language. bcoz 1)object oriented means everything should be in object but primitive data type is not object. 2) java don't support multiple inheritances which is one of the oop 's concept