Break link to Character Style with JS (CS4ME)

Hi,
I'm wondering how to break a link to a character style in JS. By break
link I mean removing the character style but preserving the formatting.
Given a selected textStyleRange, say, in the UI there are two ways of
doing this. One is to click "Break link to Style" in the flyout meny of
the character style palette.
The other is to right-click and select "Apply character style."
It's a little unintuitive, because CLICKING on removes overrides,
but right-clicking and selecting the menu option doesn't.
So when I saw that, I said to myself aha! Probably:
myText.appliedCharacterStyle = myCharStyle
is equivalent to clicking on , while
myText.applyCharacterStyle(myCharStyle)
is equivalent to right-clicking on and choosing "Apply character
style."
But it isn't.
They both apply None and remove all formatting.
So, anyone know how to break a link to character style without removing
formatting in JS?
Thanks,
Ariel

Thanks Peter. That's interesting. After Shabbos I'll have to try figure
out how to apply a character style without removing overrides as well.
It may be a two-step procedure.
Thanks,
Ariel

Similar Messages

  • Niceties of apply the [None] character style and its relation to Break link to Character Style (CS4 upwards)

    Hi,
    Am I the last to realise that, with text selected, clicking on is
    different from right-clicking on and selecting "Apply " in
    the character palette?
    Let me explain: Say you have some text selected. The text has a
    character style applied called "Superscript", whose only attribute is to
    apply superscript.
    Now, with that text selected, if you click on the result is that
    is applied and all formatting is lost.
    But, if you right-click on and choose "Apply " from the
    context menu, is applied but formatting is NOT list. Effectively
    this is the equivalent of choosing "Break link to style" in the flyout
    menu of the character palette.
    Curious to know if you've come across that that distinction before?
    Thanks,
    Ariel

    Sorry Peter. On behalf of the stupid Jive forums, I do apologize. Everywhere in my post where I wrote [None], it was jived up a little and changed to a link. (I've only got Internet access during breaks -- a self-imposed firewall that allows me to actually get some work done.)
    The post shoudl have read:
    Hi,
    Am I the last to realise that, with text selected, clicking on [None] is different from right-clicking on [None] and selecting "Apply [None]" in the character palette?
    Let me explain: Say you have some text selected. The text has a character style applied called "Superscript", whose only attribute is to apply superscript.
    Now, with that text selected, if you click on [None] the result is that [None] is applied and all formatting is lost.
    But, if you right-click on [None] and choose "Apply [None]" from the context menu, [None] is applied but formatting is NOT list. Effectively this is the equivalent of choosing "Break link to style" in the flyout menu of the character palette.
    Curious to know if you've come across that that distinction before?
    Thanks,
    Ariel

  • [JS] How to break link to paragraph style from script?

    I don't found the command break link to paragraph style from script.
    I want "unapply" the style from the text, but leave the formatting intact.
    Can help me?

    In the interface it's a separate command ("Break link to style"), but it seems in a script you have to use
    Paragraph.applyParagraphStyle (using:ParagraphStyle[, clearingOverrides:bool=true])
    You cannot use "null" or something similar for "ParagraphStyle", so I guess the idea is to use paragraph style #0 in your document (which is always "[No Paragraph Style]"). Be sure to set "clearing Overrides" to false, as it defaults to true.
    The following single line works on your current paragraph:
    app.activeDocument.selection[0].paragraphs[0].applyParagraphStyle (app.activeDocument.paragraphStyles[0], false);

  • Need script to place line break based on character style

    I'm a designer and know very little about scripting or XML, but here goes. I have some XML files I'm formatting for print, and they don't have paragraph returns where they need to be. The returns always need to be before a specific XML tag (that I can change to a specific character style to make it easier to find...). But I don't see a way to do this using the usual InDesign Find/Replace tools, so I assume scripting is going to be the answer. Anyone know how to accomplish this?
    Here's an example of the content I'm working with. The breaks need to happen BEFORE each <City> element. I'm using InDesign CS6 on a Mac.
    <?xml version="1.0" encoding="UTF-8"?>
    <Regions><Region>
    BIG BEND COUNTRY<City>
    <City_Name>ALPINE                       
    </City_Name><Event_Name>
    Big Bend Ranch Rodeo                                                                                </Event_Name>
    <Date>August 8-9                                                                                                                                                                                                                                                         
    </Date><Venue_Name>
    Sul Ross State University S.A.L.E. Arena</Venue_Name>
    <Website1>www.bigbendranchrodeo.com                                            
    </Website1><Phone1>
    4323642696</Phone1>
    <Phone2></Phone2>
    </City><City>
    <City_Name>ALPINE                       
    </City_Name><Event_Name>
    Big Bend Balloon Bash                                                                               </Event_Name>
    <Date>August 30-September 1                                                                                                                                                                                                                                                     
    </Date><Venue_Name>
    Alpine-Casparis Municipal Airport</Venue_Name>
    <Website1>bigbendballoonbash.com                                        
    </Website1><Phone1>
    4328377486</Phone1>
    <Phone2></Phone2>
    </City><City>
    <City_Name>EL PASO                      
    </City_Name><Event_Name>
    Alfresco! Fridays                                                                                   </Event_Name>
    <Date>August 1, 8, 15, 22, 29                                                                                                                                                           
    </Date><Venue_Name>
    Convention Center Plaza</Venue_Name>
    <Website1>www.alfrescofridays.com                                              
    </Website1><Phone1>
    915/534-0600</Phone1>
    <Phone2/></City>
    Thanks in advance!

    karol wrote:
    You can use [ code ] tags when pasting code https://bbs.archlinux.org/help.php#bbcode
    For it to really auto-update the mirrorlist it has to be put in a cronjob :-)
    If I run it twice, will the original mirrorlist (moved to mirrorlist.bak after the first run) be irrevocably lost?
    Just nitpicking: you don't have to use 'g' for global changes in the sed substitutions as there is only one occurrence per line.
    Thanks Karol - I made the adjustments above to address both comments. The 'g' for sed I think is OK to leave in :-)
    Last edited by Archieman (2011-05-31 04:00:55)

  • Numbered bullet character style with underline not showing

    Hi,
    I have a paragraph style for numbered bullets where I've used a character style for the numbered bullet.
    The character style has an underline applied so the effect looks like white text on a blue box, the blue box being created by the underline.
    The 'Paper' coloured number is showing, I can see it by placing a coloured box behind the text box to test.
    But the blue underline is not showing. When I apply the character style on other text it works fine.
    Could this be a bug?
    InDesign CC, Mac OS X 10.8.4

    Thanks for responding.
    "Paper" is the colour I am using for the character colour and then using another named colour for the underline.
    But it is happening the same as you suggest in your screengrab.
    In my screengrab below I have put in a black box to show that there is no underline appearing!
    And my paragraph style with that character style applied:
    So how do we submit this as a bug? And why hasn't it been fixed before now?!!!
    thanks.

  • Import swatches, styles, symbols, character styles with applescript

    I've done plenty of Illustrator scripting with applescript, but can't seem to find a way of automating import of swatches, styles, symbols, and/or character styles from existing file. Any help would be much appreciated.
    Thanks.

    Oh sorry forgot to tell you what I usually do with this. To get around it, I usually create an empty document with all the library of a document category on it and save that document to a server. If anyone want to create a document of that type I would just tell them to grab that file from the server to their local computer. It won't work if you are editing existing document UNLESS, you don't want the library saved only to the old document. In that case you can just copy every thing on the old document with script and paste it on the pre-made document that have all the library on it.
    Sounds pretty low tech, but it gets it done.
    ZW

  • How to apply bold character style with grep

    finding bold characters in a particular paragraph style
    I want to apply a character style
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.string = String.Bold;
    if (app.findGrepPreferences.appliedParagraphStyle == myPar) {
    app.changeGrepPreferences.appliedCharacterStyle = myCar1;
    app.activeDocument.changeGrep();
    app.findGrepPreferences = app.changeGrepPreferences = null;

    Try this,
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.fontStyle = "Bold";
    app.findGrepPreferences.appliedParagraphStyle = "myPar";
    app.changeGrepPreferences.appliedCharacterStyle = "myCar1";
    app.activeDocument.changeGrep();
    app.findGrepPreferences = app.changeGrepPreferences = null;
    Vandy

  • [CS3 JS] Correcting a Character Style Anomaly

    It used to be that you could define a character style to merely colour the text and give it an underline (e.g. for Hyperlinks) or just superscript the text (for Reference citations). When such styles, which do not call for a particular font or font size, are placed into InDesign CS, the styled text would take on the font and font size of the underlying paragraph style. However, after placing a Word .doc with these styles into a CS2 template, the font and font size becomes Times New Roman and 10 pt. The solution was to save an .rtf file and re-import the text. Now, in CS3 this work-around doesnt quite work: the font is okay, but the font size reverts to that default size of 10 pt.
    So, I would like a script that finds all occurrences of two specific character styles (Hyperlink and bibref) and then corrects the font size of the found text to that of the underlying paragraph style. These styles can appear anywhere within a document, including in tables. I have trawled through this forum and found enough to be able to search for the character styles, but I cannot fathom how to apply the font size of the underlying paragraph style. Any help will be greatly appreciated.
    By the way, re-applying the character styles doesnt work because the character styles dont define the font size; also clearing the overrides on the paragraph style while the text is selected isnt a viable solution, because other local formatting (i.e. italic) would be lost.

    Hi Peter
    Thank you very much for your quick response. I tried your script and it did as you intended by clearing the Font, Font Style and Point Size in the character style, but unfortunately it did not correct the problem of the style becoming some default style and size (Times New Roman 10 pt) when placed into ID.
    In fact, I had already set up the 'bibref' and 'Hyperlink' character styles with these fields blanked out. Also, I made Adobe aware of this bug when CS2 came out and they warned me that CS3 wouldn't fix the problem; but I didn't realize that CS3 would be worse than CS2 so that using an rtf file wouldn't fix things.
    So, I am left with my initial query: is it possible to write a script to search for the character styles in question and apply the font size of the underlying paragraph style?
    Thanks a lot for any help you can give.

  • How to do Pharagraph Style with wireless mac keyboard?

    I used to do shortcuts normally in InDesign like Pharagraph Style or Character Style with extended mac keyboard, but now with wireless keyboard (the short keyboard) can't find how to do it!!

    You must contact Kaspersky and have them provide an update. Firefox does not provide updates on behalf of Kaspersky.

  • [FM11] Print Image Link and Index Markers with specific Character Style

    Hello,
    I'm new with scripting for Framemaker. I want to export FM docs to RTF so I can import these into InDesign. For the placed images I want to insert a text line that is showing the image link (reference). Besides that I want to show the Index Markers at the mark insertion position with a different Character Style. Can someone help me with that?
    Regards, Sjoerd

    Hello Sjoerd,
    One note about your method to retrieve all linked graphics: this will also process the graphics that might be linked into the master and reference pages. Just to be safe against unwanted side effects you should restrict your list of graphics to the ones in the main flow of your document.
    About the tLoc: you are really looking for the anchor of the anchored frame that contains graphic. It is a little confusing that FM calls both the anchored frame and the imported graphic by the same name. Even if you add an anchored frame to the text to put an equation or a text box in your document, the anchored frame will show up in the linked list of graphics in the document. If you do have an anchored frame containing an imported graphic file, you have a list of graphic objects inside the anchored frame, which itself appears in the list of graphic objects of the document.
    This function should do what you want to do:
    function ListGraphics(doc)
              var aframe = doc.FirstGraphicInDoc;
         while (aframe.ObjectValid()) {
             if (aframe.constructor.name == "AFrame") {
                                            graphic = aframe.FirstGraphicInFrame;
                 if ( graphic.type == Constants.FO_Inset )
                                                 doc.AddText ( aframe.TextLoc, graphic.InsetFile );
             aframe = aframe.NextGraphicInDoc;
    I assume you will also want to remove the anchored frames (the imported image files) from the text. This can be done in the same routine, but you must first catch the following element in the linked list of graphics in the doc before you can delete the current one. Otherwise you will only remove the first and end up with an invalid object. The easiest and safest method to do this is to create an array of elements to be deleted. After ending the while loop, you delete those objects. The full code looks like this:
    function ListGraphics(doc)
              var toDelete = [];
              var aframe = doc.FirstGraphicInDoc;
         while (aframe.ObjectValid()) {
             if (aframe.constructor.name == "AFrame") {
                                            graphic = aframe.FirstGraphicInFrame;
                                            if ( graphic.type == Constants.FO_Inset ) {
                                                           doc.AddText ( aframe.TextLoc, graphic.InsetFile );
                                                           toDelete.push ( aframe );
           aframe = aframe.NextGraphicInDoc;
              for ( i = 0; i < toDelete.length; i++ ) {
                             toDelete[i].Delete();
    This works on a small test file I created. If you need more support, feel free to contact me: jang at jang dot nl

  • Break Link with Style

    Hello all,
    I need to break a link to an object style via script. I found this discussion:
    http://www.adobeforums.com/webx?128@@.59b4d4d7
    jxswm suggests the line founds[i].applyObjectStyle(dstStyle, false, false); but this is the same as clicking on "None" and not the same as calling "Break link to style". I.e. the formatiing is lost and replaced by [None].
    Has anyone found out how to break the link without the object changing its formatting?
    Thank you very much.

    Ah, not quite. "myObj.appliedObjectStyle = myTempStyle" removes overrides. But myObj.applyObjectStyle(mytempStyle, false false) does not, so this is easily fixed.
    For any lurkers or archive-diggers (like myself ;) ) my entire routine:
      var myMenuAction = app.menuActions.item("$ID/Copy");
      app.clearOverridesWhenApplyingStyle = false;
      if (app.selection.length > 0) {
        var noStyle = app.documents[0].objectStyles[0];
        for (var n=0; n < app.selection.length; n++) {
          var myObj= app.selection[n];
          var myStyle = myObj.appliedObjectStyle;
          if (myStyle != noStyle) {
            var myTempStyle = myStyle.duplicate();
            myObj.applyObjectStyle(myTempStyle, false, false);
            myTempStyle.remove();
      } else {
        beep();
        beep();
      app.copy();

  • [JS][CS3] Break Link to Style

    Hello everyone.
    A while back ago I wrote a script to Brake Links to Paragraph Styles and Character Styles. That was easy since you can set to false the option "Clearing Overrides" when applying "No Paragraph Style" [0] or "None" [0]. But I cannot do such a thing with objectStyles "None" [0] even when setting the options to False. Every time the TextFrames get the ObjectStyle "None". And the GUI Palette is not showing a "+" as being modified.
    It does work when using "Break Link to Style" in the GUI.
    Any help would be appreciated...
    Alex.

    CTC Imaging wrote:
    Yes I did think of that solution, but I am trying to keep it clean. Especially if you are doing several document input as copy and pasting into a single document. Since I am trying to doing this automaticaly (The script is assigned to the COPY command through eventListener), if I choose ONE generic name to rename to, I will run into the same issue. Of course I could scan the DESTINATION document for that GENERIC names and add a prefix (counter) to the one I am going to rename in the ORIGINAL document. But It would not work if the DESTINATION document is not open YET! And I can't do it as PASTE because I have to copy with the correct naming FIRST.
    So the best option is to break the link. So how can I emulate "Break Link to Style" in the ObjectStyles menu from the GUI???
    Alex.
    Then you should add Date&Time at the end of name of current Char/Para/Object/Cell/TableStyle
    "MyHeaderStyle" -> "MyHeaderStyle(2010-01-04 16:12:35)"
    I don't think that you can do this TWICE in the same second in two different documents I've done something like that in one of my script and I've added 2 second extra loop to be sure that "random" name can't be duplicated
    robin
    www.adobescripts.co.uk

  • Javascript: select all text, break link to style

    Hi
    I'd like to select all text in a Document (in different independent textboxes) and then break the link to it's style (in the program in the Flyout-menu of the paragraph styles)
    Is this function scriptable (javascript)?
    How do I select all the text?
    InDesign CS6, OS10.7.4
    Thanks

    In fact, I use the adobe findchangebylist to modified, I want to do a clear setting script, not only break link to style, but when i run the script that will get error, can u help me to fix it, my script is shown as below:
    main();
    function main(){
    var myObject;
    //var myCheckSelection = false;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    if(app.documents.length > 0){
      if(app.selection.length > 0){
       switch(app.selection[0].constructor.name){
        case "InsertionPoint":
        case "Character":
        case "Word":
        case "TextStyleRange":
        case "Line":
        case "Paragraph":
        case "TextColumn":
        case "TextFrame":
        case "Text":
        case "Cell":
        case "Column":
        case "Row":
        case "Table":
         myDisplayDialog();
         break;
        default:
         //Something was selected, but it wasn't a text object, so search the document.
         //myFindChangeByList(app.documents.item(0));
                        //alert("Nothing Selected, Please Select Text Frame or Text.");
      else{
       //Nothing was selected, so simply search the document.
                //myFindChangeByList(app.documents.item(0));
                alert("Nothing Selected, Please Select Text Frame or Text.");
    else{
      alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
    var myObject;
    var myDialog = app.dialogs.add({name:"Joan New Clear Setting_v1.0"});
    with(myDialog.dialogColumns.add()){
       with(dialogRows.add()){
       with(dialogColumns.add()){
    staticTexts.add({staticLabel:"Search Range:"});
         var mySearchButtons = radiobuttonGroups.add();
         with(mySearchButtons){
         radiobuttonControls.add({staticLabel:"Current Document", checkedState:true});
                       if(app.selection[0].contents != ""){
        radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
       with(dialogColumns.add()){
        with(borderPanels.add()){
         staticTexts.add({staticLabel:"Clear Setting:"});
         var myDateButtons = radiobuttonGroups.add();
         with(myDateButtons){
         radiobuttonControls.add({staticLabel:"English", checkedState:true});
         radiobuttonControls.add({staticLabel:"Chinese"});
    var myResult = myDialog.show();
    if(myResult == true){
      switch(mySearchButtons.selectedButton){
       case 0:
                     BreakLinktoStyleDocument();
                     TurnOffHyphenationDocument();
                     myObject = app.documents.item(0);
                     myCheckSelection = false;
        break;
                  case 1:
                     BreakLinktoStyleSelection();
                     TurnOffHyphenationSelection();
                     myObject = app.selection[0];
                     myCheckSelection = true;
        break;
      switch(myDateButtons.selectedButton){
      case 0:
      myFindChangeByList1(myObject, myCheckSelection);
      break;
      case 1:
      myFindChangeByList2(myObject, myCheckSelection);
      break;
      myDialog.destroy();
      //myFindChangeByList1(myObject);
    else{
      myDialog.destroy();
    function TurnOffHyphenationDocument() {
    app.activeDocument.stories.everyItem().texts.everyItem().hyphenation=false;
    myTables = app.activeDocument.stories.everyItem().tables.everyItem();
    myTables.cells.everyItem().paragraphs.everyItem().hyphenation=false;
    function TurnOffHyphenationSelection() {
    app.selection[0].texts[0].hyphenation=false;
    app.selection[0].cells.everyItem().texts[0].hyphenation=false;
    function BreakLinktoStyleDocument() {
    app.activeDocument.stories.everyItem().texts.everyItem().applyParagraphStyle(app.activeDoc ument.paragraphStyles.item(0), false);
    app.activeDocument.stories.everyItem().texts.everyItem().applyCharacterStyle(app.activeDoc ument.characterStyles.item(0), false);
    myTables = app.activeDocument.stories.everyItem().tables.everyItem();
    myTables.cells.everyItem().paragraphs.everyItem().applyParagraphStyle( app.activeDocument.paragraphStyles.item(0), false);
    myTables.cells.everyItem().paragraphs.everyItem().applyCharacterStyle( app.activeDocument.characterStyles.item(0), false);
    function BreakLinktoStyleSelection() {
    app.selection[0].texts.everyItem().applyParagraphStyle(app.activeDocument.paragraphStyles. item(0), false);
    app.selection[0].texts.everyItem().applyCharacterStyle(app.activeDocument.characterStyles. item(0), false);
    app.selection[0].cells.everyItem().texts[0].applyParagraphStyle(app.activeDocument.paragra phStyles.item(0), false);
    app.selection[0].cells.everyItem().texts[0].applyCharacterStyle(app.activeDocument.charact erStyles.item(0), false);
    function myFindChangeByList1(myObject, myCheckSelection){
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/ScriptSupport/te.txt")
    if(myFindChangeFile != null){
            // Because the selection will change as we add/remove characters,
            // we'll need to reset the selection after each pass if we are
            // checking the selection. We'll get the index of the first character
            // in the selection (relative to the start of its parent story) and
            // the index of the last character in the selection (relative to the
            // *end* of the story, and we'll use them later in the script to
            // keep the ends of the selection in place.
      if(myCheckSelection == true){
       var myStart = myObject.characters.item(0).index;
       var myEnd = myObject.characters.item(-1).index;
       var myStory = myObject.parentStory;
       var myStoryEnd = myStory.characters.item(-1).index;
       myEnd = (myStoryEnd - myEnd)+1;
      myFindChangeFile = File(myFindChangeFile);
      var myResult = myFindChangeFile.open("r", undefined, undefined);
      if(myResult == true){
       //Loop through the find/change operations.
       do{
        myLine = myFindChangeFile.readln();
        //Ignore comment lines and blank lines.
        if((myLine.substring(0,4)!="text")||(myLine.substring(0,4)!="grep")||(myLine.substring(0, 5)!="glyph")){
         myFindChangeArray = myLine.split("\t");
         //The first field in the line is the findType string.
         myFindType = myFindChangeArray[0];
         //The second field in the line is the FindPreferences string.
         myFindPreferences = myFindChangeArray[1];
         //The second field in the line is the ChangePreferences string.
         myChangePreferences = myFindChangeArray[2];
         //The fourth field is the range--used only by text find/change.
         myFindChangeOptions = myFindChangeArray[3];
         switch(myFindType){
          case "text":
           myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "grep":
           myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "glyph":
           myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
         if(myCheckSelection == true){
          myStartCharacter = myStory.characters.item(myStart);
          myEndCharacter = myStory.characters.item(-myEnd);
          myObject = myStory.texts.itemByRange(myStartCharacter, myEndCharacter);
          app.select (myObject);
       } while(myFindChangeFile.eof == false);
       myFindChangeFile.close();
    alert("Done");
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change preferences before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    app.findChangeTextOptions = NothingEnum.nothing;
    var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
      myFoundItems = myObject.changeText();
    //Reset the find/change preferences after each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    app.findChangeTextOptions = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    app.findChangeGrepOptions = NothingEnum.nothing;
    var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGrep();
    //Reset the find/change grep preferences after each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    app.findChangeGrepOptions = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change glyph preferences before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    app.findChangeGlyphOptions = NothingEnum.nothing;
    var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGlyph();
    //Reset the find/change glyph preferences after each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    app.findChangeGlyphOptions = NothingEnum.nothing;
    function myFindFile(myFilePath){
    var myScriptFile = myGetScriptPath();
    var myScriptFile = File(myScriptFile);
    var myScriptFolder = myScriptFile.path;
    myFilePath = myScriptFolder + myFilePath;
    if(File(myFilePath).exists == false){
      //Display a dialog.
      myFilePath = File.openDialog("Choose the file containing your find/change list");
    return myFilePath;
    function myGetScriptPath(){
    try{
      myFile = app.activeScript;
    catch(myError){
      myFile = myError.fileName;
    return myFile;
    and here is my text file, te.txt
    //001
    grep {findWhat:"."} {appliedLanguage: app.languagesWithVendors.item("English: USA"), kerningMethod: "無"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, includeLockedStoriesForFind:true, widthSensitive:true}
    //002
    grep {findWhat:"."} {kinsokuSet: "繁體中文避頭尾(s)"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, includeLockedStoriesForFind:true, widthSensitive:true}
    //003
    grep {findWhat:"."} {mojikumi: "nothing"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, includeLockedStoriesForFind:true, widthSensitive:true}
    //004
    grep {findWhat:"."} {ligatures:false} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, includeLockedStoriesForFind:true, widthSensitive:true}
    //005
    grep {findWhat:"."} {gridAlignment: 1852796517} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, includeLockedStoriesForFind:true, widthSensitive:true}
    //006
    grep {findWhat:"."} {leadingModel: 1248619858} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, includeLockedStoriesForFind:true, widthSensitive:true}
    //007
    grep {findWhat:"."} {characterAlignment: 1247896172} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, includeLockedStoriesForFind:true, widthSensitive:true}

  • [JS CS3] JS method for Object Styles Break Link to Style

    I have pages full of objects that are assigned the pesky "Basic Graphics Frame" object style. I need to do the equivalent of choosing "Break Link to Style" in the Object Styles panel on all the objects in many files.
    I haven't been able to find anything equivalent to the "Break Link to Style" functionality in looking through the Object Browser. Finding all objects with [Basic Graphics Frame] object style and applying an object style of [None] doesn't do the same result. Any ideas?

    hi:
    //FindObjectPreference
    myDoc = app.documents[0];
    app.findObjectPreferences = NothingEnum.nothing;
    app.changeObjectPreferences = NothingEnum.nothing;
    app.findChangeObjectOptions.properties =
      objectType: ObjectTypes.allFramesType, //graphicFramesType, textFramesType, unassignedFramesType
      includeFootnotes: true,
      includeHiddenLayers: true,
      includeLockedLayersForFind: true,
      includeLockedStoriesForFind: true,
      includeMasterPages:true
    //var graphicOStyleName = "[Normal Graphics Frame]";
    app.findObjectPreferences.appliedObjectStyles = myDoc.objectStyles.item(1);
    var dstStyle = myDoc.objectStyles.item(0);
    var founds = myDoc.findObject(0);
    var foundsLen = founds.length, i, found;
    for(i = 0; foundsLen > i ; i++){
      //app.select(founds[i]); alert(founds[i].appliedObjectStyle.name);
      founds[i].applyObjectStyle(dstStyle, false, false);
    <pre>
    jxswm

  • Placing Word File with Character Styles

    InDesign CS5, windows 7
    I am hoping for some guidance.
    I am creating a directory from an Excel file.  This is what I have done and where I am at.
    1. Edited Excel File to ad "Headers" for Name, Address, etc...
    2. Used Mail Merge in MS word to create a Directory.
         - Created Character Styles in word for different fields.
         - Did some minor editing to remove stray spaces, etc...
    3. Placed wrod file in InDesign.  Layout is created with basic text boxes that are split into 4 columns, each box linked to the next (I have about 30 pages of this).
    At first, this was working OK, but the CHaracter styles were not coming through (Actually, they were lost during the merge in Word).  So, I did some work and found that there was a code I could add to the Merge Fields oin Word to force the Character styles to be retained.
    Anyway, I did that.  However, now when I place the Word File in InDesign, it appears to hang at "Processing Character Styles".
    I removed the code from the merge, figuring I could go back, but I still get that hang.
    Any suggestions are appreciated...
    -kaz

    Any suggestions are appreciated...
    I think I followed most of your explanation. But, since we can't see what you're doing, it's hard to know 100% what your reasons are for doing what you do. F'rinstance, I wonder why you're bothering with the Word merge at all. Without knowing why you have to run the merge in Word, I'd suggest this:
    add headers to your Excel file
    save out .csv
    Use InDesign's Data Merge tool, skip Word entirely
    Why do you need to use Word's Mail Merge? If you've never used Data Merge in ID, you should probably take a look at the Help file entry to see if it will work for you.

Maybe you are looking for

  • How to use LanguageMap attribute for Authentication Providers?

    Hi all, I couldn't find a BEA MBean-specific forum, so I'll post this here and hope you can point me to the correct people to talk to. We're developing an Authentication provider for WebLogic 8.1. We would like to have our Authentication Provider MBe

  • Dynamic Calculation of SLED for Outbound Delivery

    All, I have a situation to pick batches at the time of outbound delivery using batch determination. We have a situation where we have some materials which are expiration date managed and some which are not. I have set up the batch search strategy wit

  • Any problems/issues upgrading from iPhoto 6.0.6 to iPhoto 8?

    Hello, I am about to purchase iLife 08 and upgrade iPhoto 6 to iPhoto 8. Does anyone know of any problems in doing this, pitfalls to watch out for, etc.? Thanks, PP

  • Exporting pics back to iphone

    If I import all my pics from iphone to iphoto and then in the future want to export some of the pictures to store on my iphone..... How is that done?   easily?   Janice

  • Insert query not working?

    i have created the following table in sql CREATE TABLE cw06_student      (registrationno VARCHAR2(8) CONSTRAINT registrationno_pk PRIMARY KEY,      course NUMBER(4) CONSTRAINT student_course_nn NOT NULL,      tutor NUMBER(4),      title VARCHAR2(4) C