Apply a Style of object for anchor

Hi all

Could someone please give solution for my application.

1. find the anchor marker

2. apply a style object for the chart image by selecting parent.

myDoc var = app.activeDocument;

app.findGrepPreferences = app.changeGrepPreferences = null;

app.findGrepPreferences.appliedParagraphStyle = 'abc '.

app.findGrepPreferences.findWhat = "~ a".

var myFound = myDoc.findGrep ();

for (i = 0; i < myFound.length; i ++)

{

myFound [i] .parentTextFrames [0] .appliedObjectStyle = app.activeDocument.objectStyles.item ("Image") //Error only

}

Thanks in advance

Beginner

Hello

An anchored object is not parent, but child (pageItem) for the anchor.

myFound[i].parentTextFrames[0].appliedObjectStyle = app.activeDocument.objectStyles.item("Image")   //Error this only

Try this code

myFound[i].pageItems[0].appliedObjectStyle = app.activeDocument.objectStyles.item("Image");

Thank you

mg.

Tags: InDesign

Similar Questions

  • Use conditional tags to apply different Style sheets / Skins for purposes of brand?

    RoboHelp HTML > WebHelp appearance of layout using conditional build tags

    I have a client that provides an application to different companies and brands its product by changing the look, using a style sheet selected depending on the brand.

    Is there a way to customize a WebHelp layout, to select a style sheet and a skin 's brand, and another sheet of style and skin for the brand Band so on?

    Would this work in RH7? (The client uses this for the moment.)

    Would this work in RH8? (They could improve if this solves the problem.)

    Philip Tory, technical author

    Hello Phillip

    RoboHelp 8 offers capacity to appoint a specific CSS file in the presentation of single Source recipe. So sure.

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7 or 8 days - $24.95!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Apply the style of character for particular word only by script

    Hello

    I find the word especially in the indesign file. That must change italic character style applies.

    For example my topic levels "Ind - H1', 'Ind - H2', 'Ind - H3' have '(continued)' text, now my continuous text only get"Italic"character style for the declared position levels. Is it possible by script?

    by

    hasvi

    Maybe this can be written more short. I have two ideas:

    1.

    var curDoc = app.activeDocument;  
    
    app.findGrepPreferences = app.changeTextPreferences = null;     
    
    app.findGrepPreferences.findWhat = "see(?=:\\x20\\(continued\\))";
    var firstFound = curDoc.findGrep();
    app.findGrepPreferences.findWhat = "(?<=see:\\x20\\()continued";
    var secFound = curDoc.findGrep();
    var allFounds = firstFound.concat(secFound);
    
    for( var n = 0; n < allFounds.length; n++ ) {
        var curFound = allFounds[n];
        var curPara = curFound.paragraphs[0];
        if ( curPara.appliedParagraphStyle.name == "h1" || curPara.appliedParagraphStyle.name == "h2" ||curPara.appliedParagraphStyle.name == "h3" ) {
            curFound.appliedCharacterStyle = "italic";
        }
    } 
    
    app.findGrepPreferences.findWhat = "(?<=see):(?=\\x20\\(continued)";
    allFounds = curDoc.findGrep();
    
    app.findGrepPreferences = app.changeGrepPreferences = null;  
    
    for( var n = 0; n < allFounds.length; n++ ) {
        var curFound = allFounds[n];
        var curPara = curFound.paragraphs[0];
        if ( curPara.appliedParagraphStyle.name == "h1" || curPara.appliedParagraphStyle.name == "h2" ||curPara.appliedParagraphStyle.name == "h3" ) {
            curFound.appliedCharacterStyle = "bold";
        }
    }
    

    2.

    var curDoc = app.activeDocument;  
    
    app.findGrepPreferences = app.changeTextPreferences = null;     
    
    app.findGrepPreferences.findWhat = "see:\\x20\\(continued";
    var allFounds = curDoc.findGrep();
    
    for( var n = 0; n < allFounds.length; n++ ) {
        var curFound = allFounds[n];
        var curPara = curFound.paragraphs[0];
        if ( curPara.appliedParagraphStyle.name == "h1" || curPara.appliedParagraphStyle.name == "h2" ||curPara.appliedParagraphStyle.name == "h3" ) {
      app.findGrepPreferences.findWhat = "see|continued";
      app.changeGrepPreferences.appliedCharacterStyle = "italic";
      curFound.changeGrep();
      app.findGrepPreferences.findWhat = ":";
      app.changeGrepPreferences.appliedCharacterStyle = "bold";
      curFound.changeGrep();
        }
    } 
    
    app.findGrepPreferences = app.changeTextPreferences = null;
    
  • Is anyway for anchored objects to still be top of the line?

    When I copy an object (say a picture) in InDesign with the tool move (V) selected and then paste it into the text sometimes it's above the line and sometimes it's online. Text wrapping seems to make no difference.

    When I copy an anchored object that is well above the line and the text flows around him and then somewhere paste it elsewhere in the text, it turns into inline. How can I get these always being above line instead of having to change all?

    Change one of them to be above the line (preferably the first time you anchor)

    With the anchored object in the desired position - go to object Styles and create an object for your anchored image style and apply it.

    Now, copy and paste the object to another location in the text.

  • How to apply a style object with attributes

    Hi all
    I'm working on InDesign CS4 plugin. and to apply the style to the object on the page elements.
    When I apply the style of the object to the page element, only an object style is applied to these elements on the page, but do not ask for its attribute.
    for example, TextFrameObjectStyle that have the stroke value 8, while TextFrameObjectStyle is appying but stroke value does not apply.
    The source code which I use as follows;
    ------------------------------------------------------------------------------------------ -----------------------------------------------------------------------------

    IStyleGroupManager InterfacePtr < IStyleGroupManager > (document-> GetDocWorkSpace(), IID_IOBJECTSTYLEGROUPMANAGER);

    ObjectStyleUID UID = iStyleGroupManager-> FindByName (inStyleNameStr);

    InterfacePtr < ICommand > applyObjectStyleCmd(CmdUtils::CreateCommand(kApplyObjectStyleCmdBoss));)

    IUIDData InterfacePtr < IUIDData > (applyObjectStyleCmd, UseDefaultIID());

    iUIDData-> Set (db, objectStyleUID);

    applyObjectStyleCmd-> SetItemList (splineUIDList);

    CmdUtils::ProcessCommand (applyObjectStyleCmd);

    ------------------------------------------------------------------------------------------ --------------------------------------------------------------------------------

    Please let me know if I'm missing something else?

    Kind regards

    Jitendra

    Get IObjectStylesSuite of ISelectionManager and use of ApplyObjectStyle

    Thanks and greetings

    Saurabh Singhal

    SR. InDesign developer

    [email protected]

  • Apply a style sheet for an entire project after importation

    Hello

    I was wondering if it is possible to apply a style sheet to a project after its importation of a Word to RoboHelp8 document.

    When I import a document into a project of RoboHelp8, it won't let me apply a stylesheet at this time, so I was wondering if it would be possible to apply the stylesheet desired to the whole of the project once the import process is completed.

    Thank you

    Bogdan

    Select all subjects in the list of topics, right-click for properties, and then select the style sheet in the appearance tab.

    Good luck

    Leon

  • Apply the style of paragraph 1 above and the style of paragraph 3 below all paragraphs containing only the italics?

    Hello

    I need a script that can find the paragraphs in italics only glyphs (maybe we can change all that pretty color) and apply the style of paragraph 1 above, the style of paragraph 3 below and this paragraph in italics to paragraph style 2

    Some paragraph of text (for the 1 paragraph style)

    some italic text (for paragraph style 2)

    little text (for the 3 paragraph style)

    After you run the script, I have something like this in 3 styles different points

    a text

    some italic text

    a text

    Lost link!

    /*

    Fixing paragraph style combinations

    Version: 1.2.B

    Script by Thomas Silkjaer

    http://indesigning.NET/

    Minor version b: Bruno Herfst

    + Add any style to replace paragraphs

    + Can cancel

    */

    var the_document = app.documents.item (0);

    Create a list of paragraph styles

    var list_of_paragraph_styles = [];

    var all_paragraph_styles = [];

    the_document.paragraphStyles.everyItem () .name;

    for (i = 0; i< the_document.paragraphstyles.length;="" i++)="">

    list_of_paragraph_styles.push (the_document.paragraphStyles [i]. (Name)

    all_paragraph_styles.push (the_document.paragraphStyles [i]);

    }

    for (i = 0; i< the_document.paragraphstylegroups.length;="" i++)="">

    for (b = 0; b< the_document.paragraphstylegroups[i].paragraphstyles.length;="" b++)="">

    list_of_paragraph_styles.push (the_document.paragraphStyleGroups [i] .name + ' /' + the_document. paragraphStyleGroups [i] .paragraphStyles [i] .name);

    all_paragraph_styles.push (the_document.paragraphStyleGroups [i] .paragraphStyles [i]);

    }

    }

    var list_of_replace_paragraph_styles = list_of_paragraph_styles.slice (0);

    list_of_replace_paragraph_styles.unshift ("[no paragraph style]" "");

    That the dialog box to select the paragraph styles

    var the_dialog = app.dialogs.add ({name: 'Paragraph style pairs Fix'});

    {with (the_dialog.dialogColumns.Add ())}

    {with (dialogRows.Add ())}

    staticTexts.add({staticLabel:"Find:"});)

    }

    {with (borderPanels.Add ())}

    var find_first_paragraph = dropdowns.add ({stringList:list_of_paragraph_styles, selectedIndex:0});})

    staticTexts.add ({staticLabel: "monitoring of"});

    var find_second_paragraph = dropdowns.add ({stringList:list_of_replace_paragraph_styles, selectedIndex:0});})

    }

    {with (dialogRows.Add ())}

    staticTexts.add({staticLabel:"Change:"});)

    }

    {with (borderPanels.Add ())}

    var change_first_paragraph = dropdowns.add ({stringList:list_of_paragraph_styles, selectedIndex:0});})

    staticTexts.add ({staticLabel: "monitoring of"});

    var change_second_paragraph = dropdowns.add ({stringList:list_of_paragraph_styles, selectedIndex:0});})

    }

    }

    {if (the_dialog. Show())}

    Define paragraph styles

    var find_first_paragraph = all_paragraph_styles [find_first_paragraph.selectedIndex];

    anyStyle var = false;

    If (find_second_paragraph. SelectedIndex == 0) {}

    anyStyle = true;

    }

    var find_second_paragraph = all_paragraph_styles [find_second_paragraph.selectedIndex - 1];

    var change_first_paragraph = all_paragraph_styles [change_first_paragraph.selectedIndex];

    var change_second_paragraph = all_paragraph_styles [change_second_paragraph.selectedIndex];

    Set preferences for grep to find to find all the points with the first selected paragraph style

    app.findChangeGrepOptions.includeFootnotes = false;

    app.findChangeGrepOptions.includeHiddenLayers = false;

    app.findChangeGrepOptions.includeLockedLayersForFind = false;

    app.findChangeGrepOptions.includeLockedStoriesForFind = false;

    app.findChangeGrepOptions.includeMasterPages = false;

    app.findGrepPreferences = NothingEnum.nothing;

    app.findGrepPreferences.appliedParagraphStyle = find_first_paragraph;

    app.findGrepPreferences.findWhat = ' $';

    Search current history

    var the_story = app.selection [0] .parentStory;

    var found_paragraphs = the_story.findGrep ();

    var change_first_list = [];

    var change_second_list = [];

    Browse the paragraphs and create a list of words and mark them as index words

    myCounter = 0;

    {}

    try {}

    Create an object to in paragraph reference and the following

    var first_paragraph is found_paragraphs [myCounter].paragraphs.firstItem ();.

    var next_paragraph = first_paragraph.paragraphs [-1] .insertionPoints [-1] .paragraphs [0];

    {if (anyStyle)}

    change_first_list.push (first_paragraph);

    change_second_list.push (next_paragraph);

    } else {}

    Check if the next paragraph is equal to the find_second_paragraph

    if(next_paragraph.appliedParagraphStyle == find_second_paragraph) {}

    change_first_list.push (first_paragraph);

    change_second_list.push (next_paragraph);

    }

    }

    } catch (err) {}

    myCounter ++;

    } While (myCounter<>

    Apply paragraph styles

    myCounter = 0;

    {}

    change_first_list [myCounter] .appliedParagraphStyle = change_first_paragraph;

    change_second_list [myCounter] .appliedParagraphStyle = change_second_paragraph;

    myCounter ++;

    } While (myCounter<>

    Alert ("fact pairs fixation!");

    }

  • [AS] [CS6] Apply different styles in the context of a text

    Hello

    Currently I have an AppleScript script to fill a block of plain text with a series of chains:

    say MyTextFrame to define (content of the history of the mother) to MyText1 & MyText2 & MyText3 & MyText4

    I would like to apply a different style (MyStyle1 to MyStyle4) for each of these channels (MyText1 to MyText4).

    Precision: MyTextI strings can contain a word or a paragraph or more, so I can't apply a style to a paragraph, for example.

    Thomas

    See the syntax below

    Please note that, while the js elements begin a 0 as start at 1, so you will have to set that in the script by Uwe

    Tell application "Adobe InDesign CS6"

    Set myDocument to the active document

    page 1 of myDocument, myPage value

    myTextFrame value framework text 1 of myPage

    tell the parents of myTextFrame

    Reference value character myText 1-character - 2 of paragraph 1 of the text object

    say myText

    apply the character style with the character style "myCharStyle" of myDocument

    tell the end

    tell the end

    tell the end

    look at examples in manual https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/InDesignScripting/InD esign-ScriptingGuide - AS.pdf

    A very useful guide indeed

    Trevor

  • Help: apply different styles of Pará to several consecutive paragraphs using the script

    Hi all

    I need to apply different styles of Pará to several consecutive paragraphs using the script, something like this (found somewhere on the net):

    myDoc = app.documents var [0];

    mySel var = app.selection [0];

    var myPStyle1 = "A";

    var myPStyle2 = 'B ';.

    you need to add 6 styles here:

    var myPStyle3 = 'C ';

    var myPStyle4 = "D";

    var myPStyle5 = 'E ';

    var myPStyle6 = 'F';

    var myPStyle7 = "G";

    var myPStyle8 = 'H ';

    the last style is not necessary in the script?

    apply style 1 paragraph 1

    mySel.appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle1);

    apply styles to the paragraphs after selection

    style 2

    mySel.paragraphs [-1] .insertionPoints [-1] .appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle2);

    next style

    mySel.paragraphs [-1] .insertionPoints [-1] .paragraphs [0] .insertionPoints [-1] .appliedParagrap hStyle = .nextStyle myDoc.paragraphStyles.item (myPStyle2);

    I tried a lot, but could not find the way to extend the sequence

    Sorry, no skills in the scripts still...

    all styles have "Next Style" option enabled, but I can't use ' apply style, then next style "or object styles, because I need four different sequences of these paragraph styles:

    A-B-C-D-E-F-G-H

    A-B-D-E-G-H

    A-C-D-F-G-H

    A-D-G-H

    and I don't really want to create special clones of the same style for each sequence (Keep It Simple, they say ).

    I think that this can be done through four slightly adjusted scripts...

    any suggestions would be greatly appreciated...

    Sorry to be late to the party, I usually take up such things immediately.

    How about this one?

    1. no separate necessary script, it uses a small dialog box where you can choose what style to use. If I'm not mistaken, you can press a digit key on Windows to immediately select one of the items.

    2. it works down in the paragraph in that your cursor is located. It has nothing to do with the blocks of text, even if - consecutive paragraphs within a story always ignore the text frames.

    3. extensible: you can easily change the names of the styles in the table at the top of the page and the number of groups of style in the list.

    var styleLists = [
              [ "A", "B", "C", "D", "E", "F", "G", "H" ],
              [ "A", "B", "D", "E", "G", "H" ],
              [ "A", "C", "D", "F", "G", "H" ],
              [ "A", "D", "G", "H" ]
    ];
    
    var radiobutts = [];
    
    styleDialog = app.dialogs.add ({name:"Set Multiple Styles",canCancel:true});
    with (styleDialog)
    {
              with (dialogColumns.add())
              {
                        with (radiobuttonGroups.add())
                        {
                                  for (i=0; i		   
  • InDesign CS3 - apply the style to the selection no longer works!

    Hello

    I have a little problem with InDesign CS3 and caraters style and paragraph style.

    style options in the options section and in the text, and in a style of object (even in GENERAL pannel), 'style to apply to the selection' appear in gray and I can not select, (or check), and is uncheked.

    In the room included an immage of a panel with the uncheched 'apply the style selection '.

    Please help me, what I have to do?

    I have try all thinghs but not reistalling jump is the last chance.

    Thank you for advice.

    ALE

    Your English is very good.

    The first thing I would try replacing the InDesign preferences. It seems to me that if you have repaired permissions of Mac files, but have does not replace the application preferences themselves. On Mac, the fast lane is close ID, then restart and IMMEDIATELY (almost instantly) press and hold the control + Cmd + Opt shift keys while the application starts. You should see a dialog box asking to confirm the replacement of preference. If you don't see the dialog box, you were not fast enough with the keyboard.

    You can also do a manual replacement. Look for the InDesign Defaults and InDesign SavedData files (these are probably hidden, but it will be in your user library) and just rename, move or delete. ID will create a new set at its launch. This has the advantage that you can recover your customizations by moving the prefs old return in the case where replacing them does not solve your problem.

    Things you lose are non-standard styles default and shades, which can be re-imported from a document that uses and document presets and a printer that can be saved from the dialog boxes "Set" before replacing your prefs and reloaded after same dialog boxes.

    Peter

    Edit: I see while I was busy typing Eugene was busy looking at the picture more closely I have and gave the real answer. Good info on the replacement of prefs, however, if you need it in the future.

  • How to avoid overwriting the italics when you apply paragraph styles?

    First of all, let me say thank you to the community of Adobe's Forum for the great help over the years! You Rock! 9 times out of 10 you nail!

    OK, so I have a long document full of italics, bold and accents. Successfully, I imported the text in MS Word and kept these text features using the import options. But now, when I go to apply paragraph styles, the italics are lost. Is it possible to implement paragraph styles so that they maintain Roman, italic, bold and also special characters like accents? Thank you!

    Hi David: I just put upward (and record) queries for search/replace that I of course after you import all text. For example, I have one that is italic in the document and it goes to a character called italic style. Once I saved queries, it is very fast to run on all the stories at the same time. And once the local formatting is managed through character styles, it is intact by assigning paragraph styles.

    ~ Barb

  • In Photoshop CC2015-how I automatically apply a style to the shape layer that I draw?

    HI -.

    I work in an office with a few different versions of Photoshop on Windows 10.

    On my CS5 PSD I can draw some shape layers, like arrows and have all the styles applied automatically style palette that I draw.

    But the fellow with PSD CC 2015 workers need to use 2 markets - draw shape layer and then select the style in the style palette.  None of the settings on the top of the screen seem to allow us to apply the style we attract.

    Is there a hidden area or a preference?

    The automatic application of a style has been removed from Photoshop?

    TIA your answer.

    J2

    This is not possible with the latest Photoshop shape tool. If you want that it is a characteristic shape tool like Photoshop old tool form the best you can do is submit an idea on the Adobe site comments but you hold no breath hoping Adobe will implement your idea.  If you want this feature you will now need to regress to an older version of Photoshop as CS2. This is the version of Photoshop, I used for my second screenshot, Photoshop community customer family

  • Not applying paragraph styles does not correctly

    I don't know even how to describe this problem except that... weird.

    For example: I put a style particular to 21 PT 22 PT. leading. When I apply this style to a paragraph, it sets the text to 42/44 - twice as big. Even with a heading style. I updated PT. 41 and it comes out to pt 82. It does this for all my styles. The '+' is not appear on any of them, this isn't a matter of substitution.

    Has anyone else seen elsewhere? I'm getting nowhere attempting this nail.

    TIA

    The text has been transformed? This will mess up the paragraph styles. Do not apply to the size of the game. The paragraph style will be applied, but then the transformation will also be applied.

  • Can character or paragraph automatically apply a style to recurring words in a document?

    Can you character style or paragraph search for recurring words in a document and automatically apply a style? For example to make some "BOLD" words that appear several times in a document? To help Windows and must currently Adobe InDesign C.

    You can add a GREP style to a paragraph style to apply a character style to any match for your GREP expression, which may be your Word.

  • Need to get all the text of the particular applied character style

    Can someone help me I need to get all the texts of the particular applied character style

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    app.findTextPreferences.appliedCharacterStyle = 'style1 Character. "

    var mf = app.activeDocument.findText ();

    var myText = ";

    for (var i = 0; i)<>

    myText is myText + mf [i] .silence;.

    }

    Alert (MyText);

Maybe you are looking for