[IDCS2] Trouble applying object styles

I'm trying to apply an object style to a page item but I'm not having any success.<br /><br />I'm using IObjectStylesFacade::ApplyObjectStyleToUIDList to apply the style. <br />The style UID is coming from the IStyleNameTable/IID_IOBJECTSTYLENAMETABLE in the doc workspace using FindByName, the UIDList argument contains a kMultiColumnItemBoss (I needed to navigate down from a kSplineItemBoss to get it... this seems legitimate from the layout chapter in the docs), and I'm getting the K2Vector<ClassID> of categories from IObjStylesAttrCategoriesList::GetApplyCategories (I've tried an empty list as well).<br /><br />ApplyObjectStyleToUIDList returns with kSuccess, but the page item always ends up with the style "None". I've tried a few other things (mostly regarding which page item is passed through the UIDList) but nothing has changed. Is there anything clearly wrong with my approach? I'm doing the same thing in CS3 and haven't had any problems, strangely.

It looks like I was attempting to apply the style to a kMultiColumnItemBoss. The target should be a kSplineItemBoss. I thought I was doing this originally, but I must've been mistaken since it's working now with that change.

Similar Messages

  • 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

  • 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

  • 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

  • InDesign CS4 crashing when applying object styles

    When i try to use IObjectStyleSuite->ApplyObjectStyle with the name of an object style that is inside a group, indesign Crashed.
    I've tried using the full name of the style path -> group:stylename but it doesn't work.
    Anyone faced this problem?
    Thanks in advance.

    As a last resort, when I run into the weird problems, I go through a process of elimination to find the offender.
    As example, I would delete half the images and try the update. if it works, I know the problem was in one of the images I deleted. If it doesnt, I'd delete the other half and try again. I keep cutting the number of images I remove in half till I'm down to whatever it was causing the problem. The I save it as a newfile type and re-import/place.
    Kind of a pain in the tookas, but it works when I'm really stumped.
    HTH
    -Ted

  • [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"?

  • [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'.

  • 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.

  • 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

  • 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.

  • Object styles. Trouble placing images

    When I place an image I have to clear object overides.
    I have been using indesign since 1.5, this has only happened with CC.
    It is arcane but it is driving me mad.
    The content is not centered in the box.
    Thanks in advance.
    (PS. Random inability to save documents. Have to triple or quituple click text to select. And the program runs slow. Apart from this it's great. Hope I don't lose so much money I can no longer subscribe. This is the point Adobe jumped the shark.)

    All patches up to date.
    Please correct me – launch Indesign, open object styles, choose basic graphic frame, edit it to suit you and the square icon is showing.
    This should be the style applied to new picture boxes and placed art?
    Or am I wrong.
    Because when I place pictures the style jumps to a 'none' with overides.
    I have reinstalled etc. And this was one of the first odd things I noticed about CC
    Please advise me.

  • 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

  • Apply text styles to multiple objects

    Hey everyone,
    So here's another interface issue I can't seem to resolve.
    I've figured out how to save a text's style to be applied later (thanks Qbert), but now how do I apply that style to multiple text items without having to go to each individual item, press the text tab in the inspector, press the style sub-tab, press the style preset drop menu and press the saved preset I want to use. I have 7 project files each with 5-8 text items that need this particular style applied to it and it would be much faster to be able to do this once for each project file rather than have to repeatedly do these 5 steps for each text item. I've already tried highlighting all of the text items I want to apply this style to and there is no way to drag anything into or out of the style sub-menu.
    Thanks in advance.
    -G

    Hey Graham,
    Your question got answered on the other thread here.

  • Applying transparency to one element of an object style

    Hi.
    I have created an opbject style that also contains text, its used to go over pictures.
    Its white background which I want to be slighty transparent. Setting transparency within the object style also causes the text to be slighty transparent which I do not want.
    Is there a method to have just the background colour with transparency?

    In the Object Style Options, there's an 'Effects for' menu. Select 'Fill'.

Maybe you are looking for

  • KWin shows only black screen sometimes after suspend

    Hi. I've got an interesting, irritating, but not fatal bug here, hopefully someone can help me kill it. On my laptop, I run KDE (not KDEmod) 4.3.4, from repos, and when I resume from suspend, sometimes I get only a black screen IF the laptop is plugg

  • Main class in a Jar File

    Hi I have created a ja file containing my whole project. the jar file contains a java class which contains a main method. now i want to run this java class present in my jar file from the command prompt. is it possible to do it. can we run a java fil

  • Bug in pinning of results tabs results in multiple query results tabs

    In Tools > Preferences > Database > Worksheet there is an option called Automatically Freeze Reult Tabs. This option, when unchecked, does not seem to be working. New query results tabs are created when pressing F9 to run selected query text. Elsewhe

  • QM / MM Complaint vs total Quantity

    Hello BW Experts, I would like to analyse the complaints per vendor in comparision to the total amount received within a certain period. Therefore I have used  Datasource 2LIS_05_Q0NOTIF to get the complaint quantity. Now I wonder what´s a solid way

  • Login failed in Planning, workspace

    Hi John, This happens again twice in a day, whenever we add any new user through shared services our OpenLDAP db get corrupted. Any advice?