Apply "Script Labels" to Object Styles?

Hi again,
I think I've kind of found a solution to my previous thread. But it involves using Script Labels in order to get it to work. Problem is I've tonnes of text boxes with Object Styles applied that don't have any Script Labels applied to them. Is there a way I can apply a script label to all of my existing text frames that have a particular Object Style already applied to them?
Thanks in advance.

You could use essentially the same script I just posted but set the label rather than the itemLayer of each found object. However, it seems like a convoluted approach.
Dave

Similar Messages

  • [CS3/4, JS] Apply feather using an object style

    I was hoping to apply transparency effects via an object style using this:
    myObjectStyle.objectStyleContentEffectsCategorySettings.enableFeather = true;
    But "Object does not support the property or method..." etc.
    I'd be very grateful if someone could point me in the right direction.
    Thanks in advance -- Jeremy

    Yes, I had got that far by stumbling blindly through the undergrowth, but it still seems to leave feather switched off, according to the Object Styles Panel, and my fumbling attempts to adjust choke, noise, etc. do not seem to have any effect, so I think it really must be switched off. What gave you the impression that that line was successfully switching feather on?
    Partly, my difficulties stem from the fact that I find the Extendscript Toolkit CS4 Object Model Viewer incomprehensible. I mean, take a look at the picture below. What is "Object Model Object Model Object Model Object Model", supposed to mean, and why is every version of InDesign labelled "CS4"?

  • Find script label on object inside of another object.

    I have a graphic inside of a box the graphic has a script label. I would like to reference it and its parent but.
    var myAsset=myDocument.pageItems.item("Logo"); does not work. I am wondering if using allPageItems might work however, I have not made anything that has worked yet. Like var myAsset=myDocument.allPageItems.PageItem("Logo"); If there are any ideas about this I would appreciate the help.

    Hi Gonterman,
    Can you please try this JS Code.
    This code is select the page Items of "Logo"
    var myDoc = app.activeDocument;
    for (i=0; i<myDoc.spreads.length; i++){
         try{
              myDoc.spreads[i].pageItems.item("Logo").select();
              }catch(e){};
    This code is select the Graphics frome of "Logo"
    var myDoc = app.activeDocument;
    var myGrapic = myDoc.allGraphics;
    for (i=0; i<myGrapic.length; i++){
         var myArt = myGrapic[i];
         try{
              alert(myArt);
              if(myArt.label=="Logo"){
                   app.select(myArt);
              }catch(e){};
    thx
    csm_phil

  • [JS][CS3] Applying an Object Style

    Hi.
    This is a simple one, I am trying to apply an already made Object Style to a text frame.
    I am using a similar method as used to apply a paragraph style:
    myFrame.appliedObjectStyle.name= "GreenBox";
    and also
    myFrame.appliedObjectStyle= "GreenBox";
    But these dont work.
    I have researched the forums and found something like:
    myFrame.applyObjectStyles(GreenBox , true);
    and
    myFrame.applyObjectStyles(GreenBox);
    but these dont work either.
    Can someone give me a hand with the correct syntax please?
    Thanks in advance
    Roy

    void applyObjectStyle (using: ObjectStyle[, clearingOverrides: bool=true][, clearingOverridesThroughRootObjectStyle: bool=false])
    Applies the specified object style.
    Parameter
    Type
    Description
    using
    ObjectStyle
    The object style to apply.
    clearingOverrides
    bool
    If true, clears the Button's existing attributes before applying the style. (Optional) (default: true) (Optional)
    clearingOverridesThroughRootObjectStyle
    bool
    If true, clears attributes and formatting applied to the Button that are not defined in the object style. (Optional) (default: false) (Optional)
    -- so you can use one or even two trues; it's default is 'true'.

  • Find element by object styles  and copy it

    Hello, I would like to create a script.
    Find element by object styles :
    Outside of document, I create on block with the object style "reference". This will be unique.
    After selected, I want to put it on CLIPBOARD or just do a copy.
    If selected by object styles isn't possible, how i can make a id on my element?
    Can you help me?
    Thancks a lot!

    Thank a lot!
    So, I have a find/change with a grep code.
    I copy an element, and I launch the search. My requete says "when you find this, paste".
    I use a javascript which do all my find/change like this :
    var myTextFrame = app.selection[0];
    var myStory = myTextFrame.parentStory;
    app.loadFindChangeQuery ('PuceSimple_enPuceCouleur_Courant', SearchModes.grepSearch);
    myStory.changeGrep();
    This work very well, so If I select my element, I copy, I select my texframe, I run the script all is OK.
    But I would like that script do this :
    I select my texframe and run my script : it copy element (it find by label or object style) and run the find/change grep.
    I put it some shots :
    1 : you see that my element is selected, it has a object style name, a label name. I think that it will be outside the page. I copy it.
    2. I run the find/change
    3 it's work !
    Do you understant what I want to do in scripting ?

  • Script for applying object style to only tif, or eps or...(by extension)

    We need to apply object style to only eps files in doc, or tif.... How to do this? Maybe someone have a script?
    thanks

    @kajzica – I don't have a script for that, but it is scriptable. You surely mean that you want to apply the object styles to the container frame of the images, aren't you?
    A few minutes later – try the following ExtendScript (JavaScript) code:
    You could edit the names of the two object styles at the beginning of the script code.
    OR: you could first run the script, the script will add two object styles to the document that you can edit afterwards.
    The script will sort the EPS and the TIFs from the other image types.
    Make sure that all graphics are up-to-date and linked correctly!!
    //ApplyObjectStylesTo_ContainersOf_TIF_EPS.jsx
    //Uwe Laubender
    * @@@BUILDINFO@@@ ApplyObjectStylesTo_ContainersOf_TIF_EPS.jsx !Version! Thu Dec 12 2013 13:15:30 GMT+0100
    //Edit your style names here. Change the name between the two " " only!!
    //OR: edit your object styles in InDesign after running the script.
    var styleNameForEPS = "EPS-Containers-Only";
    var styleNameForTIF = "TIF-Containers-Only";
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    app.doScript(_ApplyObjectStylesToContainers, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, "Apply object styles to containers for TIF and EPS graphics");
    function _ApplyObjectStylesToContainers(){
    var d=app.documents[0];
    var allGraphicsArray = d.allGraphics;
    if(!d.objectStyles.itemByName(styleNameForEPS).isValid){
        d.objectStyles.add({name:styleNameForEPS});
    if(!d.objectStyles.itemByName(styleNameForTIF).isValid){
        d.objectStyles.add({name:styleNameForTIF});
    for(var n=0;n<allGraphicsArray.length;n++){
        //The EPS case:
        if(allGraphicsArray[n].getElements()[0].constructor.name === "EPS"){
            allGraphicsArray[n].parent.appliedObjectStyle = d.objectStyles.itemByName(styleNameForEPS);
        //The TIF case
        if(allGraphicsArray[n].getElements()[0].constructor.name === "Image" && allGraphicsArray[n].getElements()[0].imageTypeName === "TIFF"){
            allGraphicsArray[n].parent.appliedObjectStyle = d.objectStyles.itemByName(styleNameForTIF);
    }; //END: function _ApplyObjectStylesToContainers()
    Uwe

  • View all script labels and find an object by its script label

    Hello,
    I have an InDesign document in which many objects get a script label. I know how to view and edit the script label of an object, but is it possible to:
    1 - See a list of all the script labels of the document (as can be done with the styles for example)?
    2 - Search an object in the document by its script label?

    If you are using OSX this AppleScript displays a list of document labels:
    global labels
    set labels to []
    tell application "Adobe InDesign CS6"
        set x to every page item of active document
        repeat with i in x
            if class of i is group then
                my checkGroup(i)
            else
                my getLabel(i)
            end if
        end repeat
        display dialog labels as string
    end tell
    on checkGroup(g)
        tell application "Adobe InDesign CS6"
            set gi to all page items of g
            repeat with a in gi
                if class of a is group then
                    my checkGroup(a)
                else
                    my getLabel(a)
                end if
            end repeat
        end tell
    end checkGroup
    on getLabel(pageitem)
        tell application "Adobe InDesign CS6"
            if label of pageitem is not "" and label of pageitem is not in labels then
                set labels to labels & label of pageitem
            end if
        end tell
    end getLabel

  • İn group object applied script

    In one document, a text frame object style is applied, does not apply if the script with an object group.
    How can I solve this problem     
    for(var i = 0; i < myBox.length; ++i) {
        if(myBox[i].appliedObjectStyle == myStyle01) {
            app.findGrepPreferences = app.changeGrepPreferences = null; 
            app.findGrepPreferences.findWhat = "A"; 
            app.findGrepPreferences.fillColor = "Color01";
            app.changeGrepPreferences.changeTo  = "X"; 
            myBox[i].lines[0].texts[0].changeGrep(); 
            app.findGrepPreferences = app.changeGrepPreferences = null; 

    Try this,
    var doc = app.activeDocument;
    var myBox = doc.allPageItems;
    for(var i=0;i<myBox.length;i++)
            if(myBox[i] instanceof TextFrame)
                    if(myBox[i].appliedObjectStyle.name == "myStyle01")
                            app.findGrepPreferences = app.changeGrepPreferences = null;
                            app.findGrepPreferences.findWhat = "A";
                            app.findGrepPreferences.fillColor = "Color01";
                            app.changeGrepPreferences.changeTo  = "X";
                            myBox[i].lines[0].texts[0].changeGrep();
                            app.findGrepPreferences = app.changeGrepPreferences = null;
    Regards,
    Chinna

  • Apply an object style

    About a year ago, someone helped me create a script that applies a Character Style.
    The script is:
    try {app.selection[0].appliedCharacterStyle = "Red"} catch(e){}
    How do I do a similar thing for an Object Style?

    HI
    I am not sure if this will get a reply as it is an old thread, but I have tried your method Dave:
    myLossenge.appliedObjectStyle = app.documents[0].objectStyles.item("PriceBox");
    where there IS an object style called PriceBox, but the style does not get applied.
    Any ideas?.....
    Just answered it myself, 'myLossenge' is the image that has been placed, 'myLossengeFrame' is what I need to apply the style to.
    No need to post this, but may be helpful top others doing the same thing!.
    Cheers
    Roy

  • Indesign CS6 Object Style (Transparency) Script

    I've been trying to find and/or make my own script for a simple function in InDesign with no luck. Basically I just want all placed images to have a transparency setting of 99%. That's it.
    I know I can create an object style with this setting and could select all my graphic frames and apply the style, but it would be a lot easier if I had a script that just defaulted to the 99% transparency in every document I create.
    Please & Thank you!

    @slaos – really ALL placed graphics? Also PDFs and Illsutrator files, EPS files as well? Together with PSDs, TIFs, JPEGs, PNGs and WMFs?
    Then, and only then, run this ExtendScript code on an open document ( make a duplicate before, just in case! ):
    var myDoc = app.documents[0];
    var myAllGraphicsArray = myDoc.allGraphics;
    var myProperties = {
        blendMode : BlendMode.NORMAL,
        opacity : 99
    for(var n=0;n<myAllGraphicsArray.length;n++){
        try{
        myAllGraphicsArray[n].transparencySettings.blendingSettings.properties = myProperties;
        }catch(e){alert(e.message)};
    This would not affect the container frames, only the placed graphics inside the containers!
    Uwe

  • Find inline objects and apply object styles...

    Hi Eveyone,
    I am trying to find placed inline rules and apply object styles through javascript. Because we need some baseline shift to those rules. I getting some error while find the rules. FInd the syntax below,
    app.findObjectPreferences=app.changeObjectPreferences=null;
    app.findChangeObjectOptions.properties =
      objectType: ObjectTypes.unassignedFramesType
    app.findObjectPreferences.strokeWeight=1;
    app.changeObjectPreferences.appliedObjectStyles=app.activeDocument.objectStyles.item("WOL" );
    app.activeDocument.item(0).changeObject();
    Can anyone look into this help for me. Thanks in advance.
    Regards
    Thiyagu

    Hi Dave,
    I have tried the script after removing "s" in it. Now i am getting error like "object doesn't support the property or method 'appliedObjectStyle'". Please look into this and help me out. Herewith i attached the 'error' dialog snapshot.
    When i tried this in loop its working fine. Find the script below.
    app.findObjectPreferences=app.changeObjectPreferences=null;
    app.findChangeObjectOptions.properties =
      objectType: ObjectTypes.unassignedFramesType
    app.findObjectPreferences.strokeWeight=1;
    myFindObj=app.findObject(true);
    for(i=0;i<myFindObj.length;i++){
        myFindObj[i].appliedObjectStyle=app.activeDocument.objectStyles.item("WOL");
    alert ("DONE!");
    Regards
    Thiyagu

  • How do I generate a static caption that has an object style applied?

    For instance, I have a photo and have set up a shortcut to generate a static caption. I can apply a paragraph style to it, but I don't see a away to apply an object style that will automatically apply an 11 pt text wrap on the bottom of the text box.

    For instance, I have a photo and have set up a shortcut to generate a static caption. I can apply a paragraph style to it, but I don't see a away to apply an object style that will automatically apply an 11 pt text wrap on the bottom of the text box.

  • Applying object style to all objects in a project?

    In Cp4, it was possible to change the style of an object and then apply those changes throughout the entire project.
    How is this accomplished in Cp5?
    I have set up a default style for captions but it seems like I can only change the style of individual captions (one at a time) in the properties of each caption.
    Is there a hidden "apply to all" feature in Cp5?
    Thank you

    Hello Lilybiri,
    I really tried to follow your example but it simply did not work for me.
    >Supposing  I already have a lot of Text Captions and decide to change their style,  which can include font,
    >caption style, alignment, colors....
    Yes.
    >All  Text Captions up to that moment did use the Default Caption Style as it  was set in
    >the Object Style Manager...
    >If you want to change object styles for future projects you  have to set them in the
    >Object Style Manager without any project opened.
    This is problem one. I have one standard caption style for all my courses. I have changed the default in the Object Style Manager with and without a project opened. The change simply doesn't stick! Additionally, I have exported a new style to a .cps.
    Let me pick through your instructions:
    1. First, I open a project.
    2. I open the Object Style Manager and notice that the default caption style is back to the original Adobe default (Adobe blue).
    3. I import my new caption style. The style is called NewTextCaptionStyle.
    4. On the first slide, I select the first text caption (in Adobe Blue).
    >I then change one Text Caption  to  the new style and a + sign appears next to the
    >Default Caption Style as you can see in the screenshot.
    How do you come to that?  The moment I go to the first slide and select the first text caption, it already shows: "+[Default Caption Style]" I have not changed the caption style yet. If I select my desired caption style (NewTextCaptionStyle) from the pull down menu, there is no "+" symbol. I cannot follow this step.
    In an attempt to interpret your instructions, I went back to the Object Style Manager and changed the default caption style to what I need.
    Okay, now the [Default Caption Style] is exactly what I require.
    Back at the first slide, I select the first caption (which is still Adobe Blue). Now, I can follow your first step.
    >There are 2 quick ways to proceed now:
    >1. If  you will not use the original Default Caption Style anymore in this  project (it will have no consequences
    >for other projects), use the Save  icon (yellow highlighted) to save the changes and have a new
    >Default  Caption Style that will automatically be applied to all Text Captions  that are already created and
    >new Text Captions will get the same style  too.
    I will follow your first method.
    1. I select the Save icon. [Save Changes to Existing Style]
    ... it doesn't work. ????
    I wonder... the project that I am working with were converted from Cp4 recordings. I wonder if that is causing my grief?

  • CS3: Applying Object styles not always consistent

    Hello,
    I have a number of Object Styles, each of which have different Paragraph Styles called out. In turn, each of these Paragraph Styles calls out different fonts, font styles and sizes.
    Most of the time I can click on a text frame and all the parameters in the Object style are applied--just as it is supposed to be.
    But sometimes the font that the text is supposed to change to does not get applied. This seems to be inconsistent but there is probably an underlying order to it that I do not see.
    So why would an Object style not apply the Paragraph style that is called for in the Object style options?
    Thanks,
    Tom

    I now see the problem, though I do not know the solution.
    If I open up a new document and create a text frame, the font is that old ugly but familiar Times-Roman 12 point.
    But if I open up the template where I have many object, paragraph and character styles, one of each of these is already selected. I can either see this by opening the respective panels or above in the control panel. In fact, any text frame I create always has a top text inset.
    So my Preferences in general are OK and I'd rather not dump them. The problem is that styles are already selected upon opening this one ID file. How do I turn that off?
    In  answer to a question above, I do not simply redo the old Quark file, now in ID. I have a series of styles that are just much easier to apply in a separate ID file, rather than reinventing them in the Quark-to-ID file.
    Thanks for your questions and ideas. They helped me probe this deeper. Now I just need a solution to what I think is a simple problem (still eludes me tho!)
    Tom

  • Apply All Default Object Styles

    Captivate v5.5
    Having opened Captivate v5.5, not opened any projects and going straight to Edit/Object Styles - I have created the styles I want to work with for projects I create in v5.5...Let's call them my default styles for this question
    When I open a blank project in order to create a new project it seems (but not yet fully tested this) that my default styles have been applied. So far so good.
    However as I often create new projects based on a copy of a recently created project, the styles are not my "default" styles.
    1. How can I quickly apply all my default styles in one go to a project that has other styles already applied?
    2. Would it make sense if you could name and save your styles (and preferences) and so quickly identify and apply them ?
    Noel

    Anjaneai,
    Actually, Global Styles don't quite work that way.  If you set up a Global Style, it is ONLY available in new blank projects, not ALL projects.
    As a test, set up a new Global Style with some unique name, and then open up a project that already has a number of custom local styles created.  You'll find that the new Global Style you created does not appear in the Style list, or in the Object Style Manager.  However, if you open a new Blank project that has no custom styles, THEN the global style will show up on the Style list.
    So Noel's point is quite valid. Global styles SHOULD be available in all projects.  But that's not the way they actually work in practice.

Maybe you are looking for