[CS3] [JS] Find Change Aesthetic Kerning Pairs

Hi,
I want to find and "erase" all the aesthetic kerning values in a document with Find Change.
How do I say: "app.findTextPreferences.kerningValue" != (zero or null)
Thanks
PJB

Can't do that. ID can't find "other" attributes, only specified ones.
This one regularly bites me when authors don't use Superscript and Subscript, but make their text a few pts smaller and move it up/down a few points -- and I bet it's their (w|W)ord processor that does it!
"A" solution (as opposed to "the") is to mark all 'good' text with S&R with a color, then search for orginally-colored text.
.. Although, in your case, I think you can set all kerning to 0 and be done with it.

Similar Messages

  • [CS3 JS] Find/Change Object Problem

    app.changeObjectPreferences = NothingEnum.nothing does not seem to clear the change object preferences for me.
    app.findObjectPreferences = NothingEnum.nothing works as expected, as do both app.findTextPreferences = NothingEnum.nothing and app.changeTextPreferences = NothingEnum.nothing.
    Does anyone else use the new Find/Change Object?

    Hello. I'm new here but it seems to be the only place where I can post this question to.
    I'm working in a C# application that uses InDesign CS3 scripting. I'm trying to create an index automatically from a tabbed list of words in a text file.
    As C# is a strongly typed language, I have to cast all objects to the right type. I'm having problems when I try to add the page numbers to the created index entries using the following code (I've used the CreateIndexEntry.jsx scrip as a starting point).
    //Find all occurrences of the word or set of words (the topic name)
    ((InDesign.FindTextPreference) app.FindTextPreferences).FindWhat = topic.Name;
    InDesign.Objects foundTexts = doc.FindText(System.Reflection.Missing.Value);
    It's supposed to be an Array of Text objects (InDesign.Text) but when I try to cast each object using this
    //Code is forced because I've tried everything here
    //Loop through each finding and add page numbers to topic
    IEnumerator textEnum = foundTexts.GetEnumerator();
    while (textEnum.MoveNext())
    object text = textEnum.Current;
    topic.PageReferences.Add((InDesign.Text)text, InDesign.idPageReferenceType.idCurrentPage, System.Reflection.Missing.Value, System.Reflection.Missing.Value);
    I got the following exception (translated).
    text is not an InDesign.Text object (Interfaces doesn't match)
    So the question is what object type should I use to cast each object resulting by calling the Document's FindText method.
    Every suggestion will ve very welcome.
    Thank You very much.

  • [CS3][JS] find/change quotation marks to typographer quotes

    my document contains a lot of quotation marks but they are not typographic (the opening one and the closing one are similar (") i want them to be typographic. I tried this script and it doesn't work.
    var myDoc = app.activeDocument;
    app.findGlyphPreferences = NothingEnum.nothing;
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences.appliedFont = app.fonts.item("Times New Roman  Regular");
    app.findGlyphPreferences.glyphID = 5;
    var myFoundItems = myDoc.findGlyph();
    app.changeGlyphPreferences.appliedFont = app.fonts.item("Times New Roman  Regular");
    var r=0;
    for(i=0;i<myFoundItems.length;i++){
      app.changeGlyphPreferences.glyphID = 179;
        myFoundItems(r).changeGlyph();
    app.changeGlyphPreferences.glyphID = 180;
        myFoundItems(r+1).changeGlyph();
        r+=2;

    Hi Peter,
    your solution is pretty good while the pairs of quotes are complete and you only use one sort of typographer quotes.
    But what if once the final quote is missing?
    Or if you want to use different language sensitive quotes for a document with multilingual text?
    Another approach is to take use of the execution of typographer quotes of InDesign itself.
    First you will have to activate typographer quotes:
    app.activeDocument.textPreferences.typographersQuotes = true;
    If you now change " with " you will get ".
    That's not what you have been looking for. ;-)
    You first have to make all non-typographical quotes to one specific typographical quote (right or wrong) or a placeholder. And than you have to change the specific typographical quotes to the non-typographical quotes (sic!). After that you will find your language-sensitive quotes.
    Here is an example.
    var myDoc = app.activeDocument;
    var myRange = (app.selection.length == 1 )
    ? app.selection[0]
    : myDoc;
    myDoc.textPreferences.typographersQuotes = true;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.appliedFont = myDoc.paragraphStyles[1].appliedFont.fullName;
    theChangeGrep ( '\[\\x{0027}\\x{2019}\\x{201A}\\x{2039}\\x{203A}\]', '\\x{2018}' );
    theChangeGrep ( '\[\\x{0022}\\x{201D}\\x{201E}\\x{00AB}\\x{00BB}\]', '\\x{201C}' );
    theChangeGrep ( '\\x{2018}', '\\x{0027}' );
    theChangeGrep ( '\\x{201C}', '\\x{0022}' );
    function theChangeGrep ( f, c)
    app.findGrepPreferences.findWhat = f;
    app.changeGrepPreferences.changeTo = c;
    myRange.changeGrep();
    It takes some more search executions, that's true.
    But it's language sensitive! ;-)
    After all, apostrophes () will disturb the changing also in this approach, because they are not recognized as apostrophes but as single typographical quotes.
    To prevent from this I am still looking for a solution.
    Martin

  • [AS] CS3 Find -Change inserting soft return instead of hard

    Can anyone help identify why this script doesn't work? i want it to replace multiple returns with a single paragraph return. It's replacing with a soft return rather than a hard return.
    I copied and pasted the find grep and change grep fields into the script. I even tried it by typing "\r" into the change grep field. Any thoughts? Much appreciated!
    tell application "Adobe InDesign CS3"
    --Clear the find/change preferences.
    set find grep preferences to nothing
    set change grep preferences to nothing
    set find text preferences to nothing
    set change text preferences to nothing
    --Set the find options.
    set include footnotes of find change grep options to false
    set include hidden layers of find change grep options to false
    set include locked layers for find of find change grep options to false
    set include locked stories for find of find change grep options to false
    set include master pages of find change grep options to false
    --delete multiple graphs
    set find what of find grep preferences to "~b~b+"
    set change to of change grep preferences to "
    set myStory to parent story of item 1 of selection
    tell myStory
    set myFoundItems1 to change grep
    end tell
    set find grep preferences to nothing
    set change grep preferences to nothing
    end tell

    Shane, thanks! This worked. What I meant to have written was that when copying "~b" from the find/change field in InDesign and pasting into Script Editor, and saving, it converted it automatically to a hard return. I didn't try it manually because sometimes the obvious is elusive! (to me at least)
    Thanks again.
    Jim

  • Find/Change whole words in CS3

    Maybe I'm just being dense, but when I do a find/change in ID CS3 I can't find the option to search for whole words only. The default is set to ignore whole words, so I end up finding a lot of undesirable matches. My last search was for "air," so you can imagine how many false matches I got.
    This was quite obvious in CS2, but those options (including match case) seem to have moved somewhere where I can't find them.
    Any assistance would be most appreciated.
    Mark

    With your mouse, examine each of the icons under the Change field. A tooltip identifies each one. One of them is the one you want.
    Dave

  • CS3 Find/Change Correction

    Fellow Scripters--
    In several places in the Scripting Guide, I set the find/change options to nothing. This is an error. Setting the find/change
    preferences to nothing works; setting find/change
    options to nothing doesn't. It doesn't produce an error message, but it can mess up all subsequent find/change operations.
    The affected objects are:
    AppleScript
    find change text options
    find change grep options
    find change glyph options
    JavaScript
    findChangeTextOptions
    findChangeGrepOptions
    findChangeGlyphOptions
    VBScript
    FindChangeTextOptions
    FindChangeGrepOptions
    FindChangeGlyphOptions
    Do not set any of the above to nothing, NothingEnum.nothing, idNothingEnum.idNothing, null, undefined, or anything similar.
    If you are using the FindChangeByList example script, you might want to remove the lines that do this--I'll get a revised version posted soon. The installed version works fine with the default FindChangeList.txt file, but will cause problems if you try to use more complex grep expressions.
    Thanks,
    Ole

    Here is the version of the script for CS4 (it works in CS3 as well, much better than original CS3 version).
    http://forums.adobe.com/servlet/JiveServlet/download/2080627-12695/FindChangeByListCS4.zip
    You can also use Martin Fisher's script to record settings from Text and GREP tabs, then copy and paste them to FindChandgeList.txt file.
    http://www.kasyan.ho.com.ua/downloads/RecordFindChange_CS3_Kas.zip
    Check out also this script: http://www.kasyan.ho.com.ua/find_change_by_queries.html
    Kasyan

  • [JS CS3] Find/Change "[Basic Paragraph]" style

    I'm trying to find all occurances of the [Basic Paragraph] style and replace them with [No Paragraph Style]. I'm using:
    app.findTextPreferences.appliedParagraphStyle = "[Basic Paragraph Style]";
    app.changeTextPreferences.appliedParagraphStyle = "[No Paragraph Style]";
    I get the message "Invalid value for set property 'appliedParagraphStyle'. Expected String, ParagraphStyle or NothingEnum enumerator, but received "[Basic Paragraph Style]"."
    I've tried every combination of brackets, no brackets, quotes, no quotes, etc. It doesn't seem like this can be scripted, even though it can be done via find/change in InDesign. Am I banging my head against the wall? Does anyone know if this can be done?

    "[Basic Paragraph]" as shown in the code below doesn't work either. (the word "Style" actually snuck in as I was trying different variations. But no combination seems to work.
    If anyone knows that [Basic Paragraph] can or cannot be accessed via scripting, I'd like to know. Thanks.
    app.findTextPreferences.appliedParagraphStyle = "[Basic Paragraph]";
    app.changeTextPreferences.appliedParagraphStyle = "[No Paragraph Style]";

  • JS:CS3 Newbie needs help! find/change character styles

    I'm new to scripting and JavaScript is giving me a headache, but I'll keep trying. What I'm trying to do is automate a few things so that the production time of our school newspaper is reduced while insuring accuracy.
    I've played around a little with the text find change sample and the changing or adding paragraph styles in the InDesignCS3_ScriptingGuide_JS.pdf and I barely understand what I'm doing.
    When us page designers receive text to place in the document, our editors mark the text with tags like: < b >text< / b >, where the word "text" is to be bolded. (there wouldn't any spaces between < and b and > etc. I just did that so It'll show up here). We have basic character styles and paragraph styles set up, and we just started working with nested styles.
    Is there a way we can search for the < b > tag and bold everything after it up until the < / b > tag? Sort of the way it does for html (the way it would do for this message if I took out the spaces). It'll be great if it could remove the tags as well, but if not, I know I could create a find/change script to do the removal afterwards.
    I appreciate any input.
    Thanks!

    You've not found yourself the easiest of tasks! You need GREP find/replace, not text. Do you have any experience with GREP? It's worth investigating, it's a powerful feature. The script below handles bold. For clarity, it doesn't do any error checking: it assumes that there's a document with text in it and that the document contains a character style called 'bold'.
    // talk to Indesign, nobody else
    #target indesign
    // reset the Find/Change dialog
    app.findGrepPreferences = app.changeGrepPreferences = null;
    // find everything between <b> and  (including these codes)
    app.findGrepPreferences.findWhat = '<b>.+?</b>';
    // add 'bold' style
    app.changeGrepPreferences.appliedCharacterStyle = 'bold';
    // make the changes
    app.activeDocument.changeGrep();
    // now delete the <b> and </b> codes
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = '</?b>';
    app.changeGrep();
    You can adapt it easily to handle other codes, and at a later stage you could generalise it so that you needn't repeat whole bunches of code.
    Good luck with your first forays. Again, it's not the easiest of tasks, but it's worth getting to grips with.
    Peter

  • [JS CS3] How to load Find/Change dialog?

    Hello,
    Below is a script that uses GREP to find straight apostrophies and then change them to smart (curly) ones. The script invokes the Find/Change dialog so that the user can see what she or he is doing.
    However, if the user last used the Find/Change dialog in the TEXT mode, that is the mode that appears. I want the script to go to the GREP mode. I see that there is code for app.loadFindChangeQuery(queryName, searchMode), but I have no idea what the "queryName" is and how to use it in this script.
    Thanks for any help.
    Tom
    theGrepLoader("~'", "~]");
    function theGrepLoader(grepFindIt, grepChangeIt){
        app.findGrepPreferences = NothingEnum.NOTHING;
        app.changeGrepPreferences = NothingEnum.NOTHING;
        app.findGrepPreferences.findWhat = grepFindIt;
        app.changeGrepPreferences.changeTo = grepChangeIt;
        app.menuActions.item("Find/Change...").invoke();
    }//end theGrepLoader

    Thanks, Peter!
    I appreciate your help but I have found another solution. I am amazed at my own stupidity sometimes. You see, I do my scripting in a very lame sort of way because I have never used Javascript outside of InDesign. As such, I find myself at a disadvantage because the documentation that Adobe provides assumes that you are aware of many of the basics. Case in point: I have always had trouble manipulating strings because I NEVER KNEW that you could search and replace strings! I just could not find examples of this in the Adobe documentation. So here I was in some cases adding temporary textFrames so I could get to my strings as text contents and then removing the temporary textFrames at the end of the script. In this particular case I needed to merge several paragraphs into one paragraph. Now that I know how to search & replace strings, it is so simple to strip away all the paragraph returns (which are included in text contents). I am learning, albeit rather slowly. Thanks again.
    Regards,
    Len Swierski

  • Find Change through external text file

    Hello folks
    I am bit pretty in InDesign scripting so could you please look into this.
    How can i change any particular text field in Indesign CS3 document from text file.
    I do have find change script but for each InDesign document specific text file is assigned.
    So each time i have to modify find change GREP property that is also repetetive of work. Is there any way to get find change information should be extract from external text file.
    Many Tanks in advance

    In the FindChangeByList script, you could customize the function myFindFile(myFilePath) {...} as to search the FindChangeList text file in the document location rather than the script location. That's an example. The question is: given a document, where will you have the corresponding FindChangeList?
    @+
    Marc

  • Applescript find/change problem

    I have some text which needs to be styled in InDesign CS4 which has a bunch of extraneous tags ( eg. <b>, <i>, etc.). I have customised the FindChangeList.txt file that supports the FindChangeByList.applescript file to do things like:
    {find what:"<i>"}
    {change to:"^S"}
    which can then be picked up by a nested style. All good so far.
    Problem: the applescript will just not 'see' the strings <b> or </b> in FindChangeList.txt. It treats them like they aren't there. I can do it using the find/replace within InDesign, it works fine there, but my problem is that I have hundreds of pieces of copy to import and I'd like to automate as much as possible. Using GREP has the same effect, ie. works in find/replace within InDesign, but not with applescript.
    Any help would be greatly appreciated as this is really killing me at the moment. Thanks!
    Content of FindChangeList.txt follows. The command in the final line works, the command in the second-last line doesn't.
    (FYI the second line of code contains 'InDesign CS3' regardless of whether I use CS3 or CS4. I guess they didn't update the file)
    --FindChangeList.txt
    --A support file for the InDesign CS3 AppleScript FindChangeByList.applescript
    --This data file is tab-delimited, with carriage returns separating records.
    --The format of each record in the file is:
    --findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    --Where:
    --<tab> is a tab character
    --findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    --findProperties is a properties record (as text) of the find preferences.
    --changeProperties is a properties record (as text) of the change preferences.
    --findChangeOptions is a properties record (as text) of the find/change options.
    --description is a description of the find/change operation
    --Very simple example:
    --text          {find what:"--"}          {change to:"^_"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find all double dashes and replace with an em dash.
    --More complex example:
    --text          {find what:"^9^9.^9^9"}          {applied character style:"price"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find $10.00 to $99.99 and apply the character style "price".
    --All InDesign search metacharacters are allowed in the "find what" and "change to" properties.
    text          {find what:"<b>"}          {change to:"^S"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find all bold and replace with non-breaking space.
    text {find what:"<i>"} {change to:"^S"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all italics and replace with non-breaking space.

    You probably should post this in the ID Scripting forum. Here's an example of some simple AppleScript find and changes that might help:
    --find and replace keyboard formating
    tell application "Adobe InDesign CS5.5"
         --first clear the preferences
         set find text preferences to nothing
        set change text preferences to nothing
        --replaces non breaking space with space
        set find what of find text preferences to "^s"
        set change to of change text preferences to "<0020>"
        set myFoundItems to change text
        --replaces soft return with return
        set find what of find text preferences to "^n"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces return space with return
        set find what of find text preferences to "^p<0020>"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces 2 returns with return
        set find what of find text preferences to "^p^p"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces return, tab, return with return
        set find what of find text preferences to "^p^t^p"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces space, return with return
        set find what of find text preferences to "<0020>^p"
        set change to of change text preferences to "^p"
        set myFoundItems to change text
        --replaces space, space with space
        set find what of find text preferences to "<0020><0020>"
        set change to of change text preferences to "<0020>"
        set myFoundItems to change text
        --replaces 3 tabs with tab
        set find what of find text preferences to "^t^t^t"
        set change to of change text preferences to "^t"
        set myFoundItems to change text
        --replaces 2 tabs with tab
        set find what of find text preferences to "^t^t"
        set change to of change text preferences to "^t"
        set myFoundItems to change text
    end tell

  • Multiple find/changes into one step?

    Hi there
    I have a series of find / changes that I need to do for all the chapters in a book. They'll be the same each time, and rather than do all ten of them for each chapter I'm wondering how I can condense it into one process that I can run on each chapter, perhaps through scripting. Any ideas?
    I do have a little scripting experience, but not enough to tackle it myself yet. Is there another way to automate the steps? Or does anyone have some base code I could work from?
    I'm working in CS3 on a Mac.

    One of the standard scripts that come with InDesign is FindChangeByList.jsx -- it's installed by default in Application/Samples/Javascript. There is also a VB version.
    You don't have to adjust the script; the changes it makes are listed in a specialized format in the file FindChangeList.txt.

  • More Find/Change Issues !!

    by script I'm going to create and setup new doc, use a dialog to place a text file, and remove content from the text, format and save.<br /><br />the text file contains old msword-to-pagemaker format tags that I need to delete. the tags are in this format: <br /><br /><PmTags1.0Win><fSouvenir>    etc.<br /><br />I need to delete or convert to indesign cs3 the tags<br />(including "<" & ">" signs). <br /><br />I saved a series of 8 find/change steps to delete the content (text not grep) and need to run them consecutively and through as many as 400 entries<br />(all in the same threaded text box).<br /><br />Supposedly their is a "new" FindChangeByList.jsx somewhere that works, but I am unable to find it. the scripting/index page on adobe's website is useless, and provides no help what so ever. no links either.<br /><br />Any help would be greatly appreciated.

    Hi Seth,
    re: "Supposedly their is a "new" FindChangeByList.jsx somewhere that works, but I am unable to find it. the scripting/index page on adobe's website is useless, and provides no help what so ever. no links either."
    I just looked, and everything is still working. Go to:
    http://www.adobe.com/products/indesign/scripting/index.html
    Then click the Scripting Resources tab.
    Here are the direct links that might be helpful--first, updated sample scripts:
    http://wwwimages.adobe.com/www.adobe.com/products/indesign/scripting/downloads/indesign_cs 3_sample_scripts.zip
    Second, the scripts that go with the Scripting Guide:
    http://wwwimages.adobe.com/www.adobe.com/products/indesign/scripting/downloads/indesign_cs 3_guide_scripts.zip
    In the latter, you should take a look at the ReadPMTags.jsx script (it's in the Text folder inside the JavaScript folder of the uncompressed archive). You can take the function (of the same name) from that script and modify it to do exactly what you want.
    Also, if you don't see links or information at that page--which browser are you using?
    Thanks,
    Ole

  • Find/change in book

    Hi there
    Is it possible to perform a Find/Change search on a whole book, without having to open all the documents at once or make a PDF?
    I'm using CS3 on a Mac.

    Making a PDF would lead you nowhere
    No -- the only option is to Find/Change in all open documents. That does exactly what you already found out.
    InDesign doesn't have any problems at all with lots of documents open -- I do that all the time.

  • InDesign CS3 script that changes fonts on open

    Hello.
    I am trying to come up with a script that would change a specific group of fonts, that will always show up missing, to the new font. Basically, it is a bunch of our postscript fonts that are now using our open type font. Below is what I have so far. I want to create a list that goes through about 8 fonts that are old and replace them on the fly with the 8 new fonts. This would be great if I could have this happen on open.
    Can anyone see what I have and offer some guidance?
    thanks
    babs
    Open this Scriplet in your Editor:
    tell application "Adobe InDesign CS3"
       set find text preferences to nothing
       set change text preferences to nothing
       tell application "Adobe InDesign CS3"
           set OLDfont to {"times", "arial"}
           set NEWfont to {"times new roman", "helvetica"}
           --set find what of find text preferences to testString
           tell document 1
               repeat with swap from 1 to 2
                   set NEWfont to item swap of OLDfont
               end repeat
           end tell
       end tell
    end tell

    For starters, you're going to have to use the correct font names, including correct capitalization. The property you want to change is "applied font", not "find what". And it would probably be more sensible, to go through all paragraph and character styles and make the changes there first, otherwise you'll have troubles again every time you edit stuff.
    So start off by getting the name of the font used in every paragraph style, and loop through your list to see if they should be changed. Do the same for character styles. And then do the find/change to find any that have been applied manually.

Maybe you are looking for