Text or Grep in the Find.change script by list?

Want to use grep formatting in this request (instead of text), but the script shows the error:

text {findWhat: ') '} {"changeTo: ')" "} {includeMasterPages:true, includeHiddenLayers:true, includeFootnotes:true, wholeWord:false}

Why here coexist two ways of writing?

How do you decide?

@Laurent: Hey Hey. After this long history, I always pay attention to the original question...

Mariana:

... because it can combine several characters in a search, for example find a space before the point, period, semi-colon, etc.. Or a space after (or before)...

Yes, it is possible with GREP. Try this for the first:

grep {"findWhat:" ([.,: ;])])} "} {changeTo: '$1'} {includeMasterPages:true, includeHiddenLayers:true, includeFootnotes:true, wholeWord:false} remove the space before the period and al.

(Don't forget that the script needs TABS between the sections, as in the original file).

This is a little difficult. In fact, the period is a special character in GREp (it means "any character"), so normally you would need to escape:

(space).

to find a space, followed by a period. However, the square brackets [...] define a group of GOLD, and eliminates the magical properties of the time. Apparently, there is no use for a wildcard character in a group! (It would be something like: "the following characters are allowed: a comma, colon, not at all, a semicolon...") »)

There is a more advanced method to remove the spaces like these. You want to find spaces that are followed by one of these characters and the replacement by anything. It would be

{"findWhat:" (? = [.,: ;])])} "} {" changeTo: ' '}

You can try this in the interface to see that it works.

---

The second can be done by using the Unicode value for ellipsis ('\x{2026}' - find a different rating than in ordinary text), or with the special escape code "~ e". Well yes - there is a different escape character. The backslash is used by GREP itself, but GREP does not own InDesign special characters - include page breaks, single chip and double quotes, dash-to-here, cadratins and a few others. They can also be inserted in the menu on the right side of the search field. These characters need a tilde, so InDesign can 'translate' for something that GREP can be used internally, and GREP never sees. As the tilde is nothing special for Javascript, you can safely insert one in the script data file...

To remove a space before or after an ellipse, you can use this:

grep {findWhat: '? '} ~ e ? "} {changeTo: ' ~ e '}

... but in this case, it may still be easier to stick to the normal text mode (where you would use "^ e" for the suspension points, incidentally).

Tags: InDesign

Similar Questions

  • Open a file in the finder with script

    I have instructions for actions in pdf files. Trying to make a script that opens a specific folder in OS x Finder (/ applications/Adobe Photoshop CS6 / Instructions / FileNameHere).

    Is this possible. An alternative is to have only the script go to the finder and show the folder. Or if its possible also opens all files in this folder (but maybe that's not necessary if it is difficult)

    Any ideas?

    Open the folder

    var myFolder = file ('path');

    myFolder.execute ();

    Open the file

    var myFile = file (' path/file.pdf");

    myFile.execute ();

    Let the user select a folder and open all the .pdfs in the folder

    myFolder var is Folder.selectDialog ('select the file!');.

    myFiles = myFolder.getFiles ("*.pdf") var;

    for (var i = 0; i)< myfiles.length;="">

    [i] myFiles .execute ();

    };

  • Text when scrolling of the page changes color

    When the scrolling text change color until it stops moving

    It was very good work. Play well.
    Please report your last post as solved while others will know.

  • How to use the find method to search for multiple items in a single paragraph?

    I'm desigining a script to find all instances where ctrl + b and ctrl + i are applied to body text and then replace the format of these characters replaced with chartag italic or bold.  Here's what the script is supposed to do:

    1. put the find method in a while loop that overrides seeks format character.
    2. If a substitution of format character is found, pass the text range returned by the find method and the CharPropsChange flag in the GetTextForRange method.
    3. Use a Boolean comparison between the idata of the text element to the angle of character and character constant weight.
    4. What that is the boolean is set to true, and then use the SetTextProp method to set the properties of the text range for the italic or bold character tag properties.

    This script works on the substitution of format first character found however it ignores other substitutions in the same paragraph. The cause of this is that the while loop updated the line of text control used by the find method for the following paragraph in the stream. I think I need to add an inner loop that runs through all the text in a single paragraph, where teaching iteration the loc text used by the find method is based on the same paragraph, but the offset is changed. I don't know how to do this.

    function removeOverrides (RPSC)

    {

    var vDocStart = pDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

    var vBoldFmt = getCharFmt (RPSC, "Bold")

    var vItalicFmt = getCharFmt (RPSC, 'Italic')

    initFA_errno ();

    While (FA_errno is constant .FE_Success)

    {

    var vTextLoc = new TextLoc(vDocStart,0);

    var vFindParams = findOverrideParams (CDRP);

    var vTextRange = pDoc.Find (vTextLoc, vFindParams);

    If (vTextRange.beg.obj.ObjectValid ())

    {

    var vTextItems = pDoc.GetTextForRange (vTextRange, Constants.FTI_CharPropsChange)

    If (vTextItems.length ==! 0)

    {

    If (vTextItems [0] .idata == constant .FTF_WEIGHT)

    {

    pDoc.SetTextProps (vTextRange, vBoldFmt.GetProps ())

    }

    If (vTextItems [0] .idata == constant .FTF_ANGLE)

    {

    pDoc.SetTextProps (vTextRange, vItalicFmt.GetProps ())

    }

    } else (Log (vLogFileName, ' \nERROR: none of the items were found in the table in text format but alternative size were found: ' + pDoc.Name))

    }

    vDocStart = vDocStart.NextPgfInFlow;

    }

    }

    function findOverrideParams (RPSC)

    {

    var vFindParams = AllocatePropVals (1);

    vFindParams [0].propIdent.num = Constants.FS_FindObject;

    vFindParams [0].propVal.valType = Constants.FT_Integer;

    vFindParams [0].propVal.ival = Constants.FV_FindCharacterFormatOverride;

    Return vFindParams;

    }

    Another approach (which is what I usually did) is after the first search to set vTextLoc = vTextRange.end

    Whatever it is, you might consider moving your initialization of vTextLoc and vFindParams outside the while loop. The settings do not change, why redefine them for each search?

  • Photoshop CS3 can not save a file when it is selected in the Finder

    Photoshop CS3 can not save a file when it is selected in the Finder: "cannot save ' [filename] ' because the file is already in use or has been left open."

    I am running Photoshop CS3 on Mac OS X Yosemite 10.10.5.

    Is there one solution other than to get a new version of Photoshop? It is quite annoying to have to switch to the Finder and deselecting the file that I work with.

    Well, I specifically asked if there was one solution other than to get a new version of Photoshop.

    I found a way to do so; Open the file does not by double-clicking, but by right clicking. He let the file not selected in the Finder, at least in list view or column.

  • Find format preferences in a script of find/change GREP?

    Hi all

    I create my first script to search/replace to run GREP queries several at once. But I am struggling to find how to specify the Format to find: preferably in the script that can be in the usual find/replace dialog box.

    Here is an example of a line in my script. What I want to achieve is for the line search for words/characters who currently have [standard paragraph] applied and then change the format of a paragraph style particular, I called "team name"...

    grep {findWhat: "(.+) ', appliedParagraphStyle: '[standard paragraph]'"} {changeTo: '$1', appliedParagraphStyle: 'The team name'} {} / / apply style name team

    BTW, I use the standard FindChangeByList script that comes with Indesign. Any help/comments are appreciated.

    See you soon,.

    Marco

    Instead of the name of the style, try the object of paragraph style:

    grep {findWhat: "(.+)", .paragraphStyles appliedParagraphStyle:app.documents [0] [1] ""} {changeTo: '$1', appliedParagraphStyle: 'new style'} {}

    Peter

  • Find/change Grep can't find one instance per paragraph, where wrong me?

    Hello

    I use a find/change Grep to find any price with a comma and change this comma to a thin space (the newspaper style).

    But the Grep considers only the first instance of this paragraph.

    Example of text...

    "$200 $200 000 000 $200,000."

    text at the beginning of paragraph $200,000

    $200,000 at the end of the paragraph text

    $200,000 tab. »

    In the sample, the grep would miss the second and third prize on the first line.

    I use...

    Find...

    (?<=\$) (\d{3})\,? ({\d{3})

    also tried (\$\d{3})\,? ({\d{3})

    Set up...

    $1 ~ <$ 2

    Is there anything I can add to find these last two prices?

    I use this in combination with script Batch find replace, so different greps are set up for 5, 6 and 7 digits starting by $.

    Thank you.

    Try this,

    (?<>

  • Problem with find/change GREP

    Hi, try to run by default find/replace InDesign AppleScript script to solve many formatting problems in a large document. One of them is occurences of a two-digit dollar figure followed by a comma (eg. "$ 10") that needs to be changed to have no comma.

    Use GREP I can pick it up by searching for "\$\d\d", but when I replace it with '\$\d\d' I get the string "\$\d\d". IE. "$ 10" becomes "\$\d\d" instead of "$ 10." I'm misunderstanding how works the part 'change' grep? Can someone advise?

    FYI the line in the search/replace support .txt doc is:

    grep{find what: "-\\d\\d$,"}{change to: "\\$\\d\\d"}{include notes: true, include master pages: true include hidden layers: true, any word: false}Remove commas after the price.

    .. What includes the extra backslashes to escape the backslash which are part of the GREP expression.

    Any help much appreciated!

    Thank you.

    On Grep Pallette, use below syntax to find two or more digit dollar figure followed by a text of commas,

    Search: (\$\d+),

    Change of: $1

    Vandy

  • counting in a find change grep

    I have a script that runs several find change greps and alert how many each grep search were made.

    This is the code:

    See section function () {}

    app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findGrepPreferences.findWhat = "the (section\\s +?). \\d+ ? [ \\.\\d+]?)";

    var changed = app.changeGrepPreferences.changeTo = "$1";

    Reference of the changed.appliedCharacterStyle = "cross";

    var changes1 = app.activeDocument.changeGrep ();

    If {(changes1.length = 1)

    Alert (changes1.length + "instance of 'the section' became 'article'.");

    } else {}

    Alert (changes1.length + "instances of 'the section' changed to 'section'.");

    }

    };

    No matter how many changes I know she took it returns 1.

    It also does not apply the character style to the entire reference. The character style is supposed to underline the Word section \d.

    He pointed out only half of the section of Word:

    section5

    Do not know what is happening.

    (1) make sure of course, you have the same name "cross references".

    (2) when checking a condition use double ==

    If (changes1.length == 1) {and NOT so {(changes1.length = 1)

  • How to find the character / change size?

    Customer request goes like this.  Change all trademarks and balls to pt 7.

    The document is huge and will take forever.  Is it possible to do this with an advanced find/replace script?

    Fact complex doubling as a query is specific® and the other is built in the style that InDesign does not recognize as a character in the search field.

    Maybe something I'm on fast application?

    Help ~ I really don't want to have to finger through this whole doc.

    Use the tab of GREP Find/Change.IN find it what field enter 8 ~ | ~ r (it's the tilde-eight-vertical bar-tilde-r). Let the change to blank or enter $0 and in changing the formatting Click on basic character Formats and set the size. Define the scope of the search and all of the changes.

  • How to change the size of the font for the finder windows?

    The font size in the finder and the general text boxes is too small for our use. It can be increased? I can't find anything for this in preferences.

    Finder

    Launch the Finder.

    Click on the "View" menu in the Finder menu bar, then "options".

    A small dialog box opens.

    Click inside the box pop up next to "text size: ' and choose the font size.

    There is no possible preference to change the font size in the other text boxes.

  • Programmatic equivalent to the Find dialog box change functions

    Hello

    Is there a reasonable programmatic equivalent of the buttons change to the Find dialog box? FDK or ARE? I have no urgency to find one, but I was going to use it if they are available. I'm looking for something simple and direct, not savages button-push-automation-routines or something like that.

    I hope this isn't a stupid question. I'm amused that after all these years, this is the first time I ever thought that the need for it.

    Russ

    Hi Russ,

    using 'find', you will receive a textlocation. Now, he must 'manually' change the text with oDoc.Delete (TextRange) and then insert your text replace.

    I hope I understood your question right?

  • Is it possible to search for text in an Illustrator file from an external source like the Finder (Mac)?

    I'm trying to find some similar text strings on hundreds of files.  Specifically, I'm looking for dimensions.  4.50 "for example.  I want to see how many files have this dimension within them so that I can group them for production purposes.

    Is there a way to search for text in Illustrator (I use CS5) files from Finder?  Or another program of research?  I use a Mac.

    Any help would be GREATLY appreciated and would help save me a lot of time.

    Yes. While the Finder cannot find the content of .ai files, it can do it with .pdf files. If you change the extension of a .ai in .pdf file, you can use Spotlight to search by content.

    This fact, combined with a file rename utility as A Better Finder Rename, you can leave temporarily rename all of your .ai files so they end up in something like 'RENAMED.pdf '. Then, once you have performed your search, find all files ending in RENAMED.pdf, to delete the word "RENAMED" and change the end for .ai again.

    Of course, this isn't something you want to get into the habit of doing.

  • I need serious help please... We do translations of textbooks, I searched an excessive type function but have been unable to find, we are working in indesign CS 5. It takes allot of time to delete the text and type in the new language.

    I need serious help please... We do translations of textbooks, I searched an excessive type function but have been unable to find, we are working in indesign CS 5. It takes allot of time to delete the text and type in the new language.

    Argh it's frustrating! I never noticed that the key was not working in InDesign.

    A bit of research and it turns out that the MS Office has this as an option in their software. But I can't find an option in the InDesign preferences to make it work.

    However, somethings do not appear in the shortcuts and preferences and are hidden triggers in InDesign that are accessible via a script.

    I'm not saying that it is possible to activate the button insert by using a script, but it is plausible that he can be activated.

    Maybe ask on the forum script? Scripting InDesign

    I know that this may be a possibility as with InDesign prior to export PDF documents interactive versions, there was previously no way to export PDFs interactive as unique pages if the gaps of.

    But the option to toggle this setting was scriptable.

  • Need to GREP expression to find. MD, PhD, FAAC. etc but not the end of the sentence

    I'm just starting to utiilize GREP a bit and tried to write an expression it would find two or more uppercase or upper case, lower case, upper case combination followed by a period such as. MD, PhD, FAAC. etc. I'm trying to find these instances and delete the period so that he says, M.D., Ph.d., FAAC etc.

    I came up with (\u\u|\u\l\u+)\. that works well, except that he also finds something with 2-3 letters at the end of a sentence, which I did not ' hold.

    I also used $1 in the change to box to capture phrases which seems to work very well as well.

    I really just do not find anything at the end of a sentence.

    Maybe something with the advanced search or postanalyse. Which confuses me as well.

    Thanks for any help in advance.

    Hi dgriffin1951,

    Sorry, my English is too bad. In my opinion not looking". MD, PhD, FAAC. " but the point after " MG or PhD or FAAC «»

    But perhaps it could be useful:

    using Grep find & replace

    To find:

    (?<>

    Replace with:

    $1

    It is a little tricky, because most other greps are also find' St. ' "in Inc., St. Louis, MI «»

    Please give an answer.

Maybe you are looking for

  • Re: Satellite A660 - media buttons do not work

    First of all I apologize if my language is not good, because I'm Spanish. I have a * Toshiba Satellite A660-13D * and this model has a button touch media at the top, next to the keyboard. Here is a picture with the buttons marked in red: [http://foru

  • Satellite P105: "change the Frame Buffer"

    Hi, I have read through some topics here on the video memory change and continue to see the word Frame Buffer. The tab is not present in the option of setting advanced my driver and does not appear in the BIOS. Where can else I get? In addition, abou

  • 646 error code when I try to down load updates

    Downloading the updates, I get "unknown error code 646." 3 updates failed. "I am running Vista Home Premium SP2.

  • Auto 7 d back to the default settings

    Here's an interesting problem: I have a 1 year old factor refurbished EOS 7 d, I use exclusively for that I generally shoot at 24 fps video recording... Recently (ON ALL MODES of shooting), it automatically returns to stop a minute and 30 frames per

  • Vista restarts when you try to configure the updates (stage 3 of 3 0% complete)

    Hi all Some time ago I got a video card fails on me during an upgrade. Of course, I had to stop him to bring it to the store for repair. Given that the video card has been fixed I can't restart the machine at all. I tried to start in safe mode, but u