GREP in FindChangeByList-script!

Hi!
Running the script in IDCS3 and it works well, but...
I want to use a GREP search and change the Character Style for the result.
{appliedCharacterStyle:"xxx"} only works if the search is TEXT. How can I make the same work in a GREP line???
And Yes! I know CS4 will do it without a script, but I need it to work in CS3.
Suggestions anyone???

Hi Jongware,
Thank you for the reply.
I tried the double slashes and get an Error 25. So something I'm doing in the Search/Replace portion isn't working.
However, I did have success with changing a style by using a GREP search. The line below works with the double slashes, just not the Find/Change lines:
grep
{findWhat:"\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d"}
{appliedParagraphStyle:"Z BB Box Exp Batting 07T"}
{includeFootnotes:true, wholeWord:false, caseSensitive:false}
//Changes style

Similar Messages

  • Adding GREP search to FindChangeByList script in CS4

    I'm trying to remove numbers from a baseball box score pulled from the Internet.
    The file has 10 numbers across separated by tabs and I only need six of the numbers not all 10
    St. Lucie Mets
    Player,Pos         AB     R     H     2B     3B     HR     RBI     BB     SO     AVG
    Daniel Muno, 2B    4     1     1     0     0     1     1     0     2     .259
    Robbie Shields, DH     4     0     2     1     0     0     0     0     1     .471
    This GREP search works in FindChange in InCopy/InDesign (using CS4)
    (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d)
    This works in the Change field
    $1 $2 $3 $7 $8 $9
    However, when I try to add this to a FindChangeByList script, it generates an error. So my syntax, logic or both is flawed.
    What should I do to fix it?
    grep    {findWhat:"(\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d)"}    {changeTo:"$1 $2 $3 $7 $8 $9"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.
    Thank you,
    Keith

    Hi Jongware,
    Thank you for the reply.
    I tried the double slashes and get an Error 25. So something I'm doing in the Search/Replace portion isn't working.
    However, I did have success with changing a style by using a GREP search. The line below works with the double slashes, just not the Find/Change lines:
    grep
    {findWhat:"\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d\\t\\d"}
    {appliedParagraphStyle:"Z BB Box Exp Batting 07T"}
    {includeFootnotes:true, wholeWord:false, caseSensitive:false}
    //Changes style

  • FindChangeByList script question, re: when a style is part of a style group

    Hi,
    I'm using InDesign's FindChangeByList script and am running into a problem.
    Here is the problem line:
    grep {findWhat:"^."} {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent"), changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style
    What I am trying to do is format every paragraph with the style called "Body2.TextIndent" which is located in my style sheets under a group called "Text"
    This line is not working for me; I get a JavaScript  "Error #17. Error string: variable name expected."
    Please note that I CAN get this line to work just fine if I use a style that is NOT in a group. For instance, this line works fine for me:
    grep {findWhat:"^."} {appliedParagraphStyle:"Body2.TextIndent", changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style
    The problem is apparently that the FindChangeByList script doesn't like style groups. I found this by Googling the internet and found this link:
    http://www.listsearch.com/indesign/Thread/index.lasso?17986
    Can anyone help?
    Thanks.

    Kasyan, it works for me now! THANKS! One thing... I notice that in your line, you removed the part "changeConditionsMode:1919250519". Maybe that was the problem? I'm new to scripting. What does that line do? Can I leave it out?
    p.s. I'm using CS4 on Windows XP Pro

  • Newbie question on FindChangeByList script (REVISED)

    Hi...I'm using FindChangeByList (the Javascript version) and I have a question. The default behavior of this script seems to be the following:
    1. If text is selected, then run the script on the text
    2. Otherwise, run the script on the entire document.
    By looking at the script (which I'm pasting below), I can see that the script is intentionally set up this way. I'm totally new to scritping, but by reading the remarks I think these are the relevent lines:
    //Something was selected, but it wasn't a text object, so search the document.
         myFindChangeByList(app.documents.item(0));
    and
    //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    MY GOAL:  I want to prevent the script running on my entire document by mistake if I mistakenly don't have the Text tool active.
    I have a feeling that would be very easy to write, but since I know nothing about scripting, I appeal to this forum. Thanks.
    If you need it, the entire script is pasted below. (It's also a standard sample script built into CS4).
    //FindChangeByList.jsx
    //An InDesign CS4 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 2.0.0.0 10-January-2008
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The 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 {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash.
    //More complex example:
    //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"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 "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
    var myObject;
    //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 "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));
      else{
       //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    else{
      alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
    var myObject;
    var myDialog = app.dialogs.add({name:"FindChangeByList"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       with(dialogColumns.add()){
        staticTexts.add({staticLabel:"Search Range:"});
       var myRangeButtons = radiobuttonGroups.add();
       with(myRangeButtons){
        radiobuttonControls.add({staticLabel:"Document"});
        radiobuttonControls.add({staticLabel:"Selected Story", checkedState:true});
        if(app.selection[0].contents != ""){
         radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
    var myResult = myDialog.show();
    if(myResult == true){
      switch(myRangeButtons.selectedButton){
       case 0:
        myObject = app.documents.item(0);
        break;
       case 1:
        myObject = app.selection[0].parentStory;
        break;
       case 2:
        myObject = app.selection[0];
        break;
      myDialog.destroy();
      myFindChangeByList(myObject);
    else{
      myDialog.destroy();
    function myFindChangeByList(myObject){
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/FindChangeSupport/FindChangeList.txt")
    if(myFindChangeFile != null){
      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;
       } while(myFindChangeFile.eof == false);
       myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change preferences before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = 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;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = 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;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change glyph preferences before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = 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;
    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;
    Message was edited by: JoJo Jenkins. Proper script formatting was used and the question was revised and made more concise.

    You can't check which instrument is active in InDesign by script (although you can select it, but it's not useful in your case).
    I suggest you  the following approach: check if a single object is selected and if it's a text frame — if so, make a search without showing the dialog.
    Notice that use
    myFindChangeByList(app.selection[0].parentStory.texts[0]);
    instead of
    myFindChangeByList(app.selection[0]);
    this allows me to process threaded and overset text.
    function main(){
         var myObject;
         //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 == 1 && app.selection[0].constructor.name == "TextFrame"){
                   myFindChangeByList(app.selection[0].parentStory.texts[0]);
              else 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 "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));
              else{
                   //Nothing was selected, so simply search the document.
                   myFindChangeByList(app.documents.item(0));
         else{
              alert("No documents are open. Please open a document and try again.");

  • FindChangeByList script to include Style Groups/sub Style Groups

    I've been using this function happily (with varying degrees of success & lots of trial and error) for a while now. I'm not a script writer, understand very little but manage to copy and paste, and hope for the best.
    This has served my wishes for the most part, but I have the need to apply a GREP search/replace to some text that needs to be styled with a paragraph style that lives inside a style group, inside another style group.
    Style group called 'Headings', inside which is a style group called 'News from Areas heads' inside which is a paragraph style called 'b head_red (News from areas)'
    I have picked up on helpful examples from others for applying a paragraph style that lives within one level of "Style Group", but don't know what the correct syntax to describe: a paragraph style within a folder, within a folder, within another folder might be?
    I did wonder if the choice of underscores and brackets in the paragraph style may not help.
    MTIA
    Steve

    Hi Jarek
    Unfortunately I don't have much scripting knowledge, but to answer your questions
    1. paraStyle real name is "b head_red (News from areas)"
        - "b head_red" is used elsewhere. Why didn't I keep it simple?
    2. Do your findWhat string work in UI (run manually)?
        - yes, when I use normal GREP find/change it works okay.
    3. Do your FindChangeByList.jsx work with some simplier example?
        - yes, I use it often. The .txt file I'm working on at the moment already contains about 10 text/glyph changes which work fine. I have had success in applying a 'paragraph style' that is within a 'style group'. But this is the first time I've tried to apply a 'paragraph style' that is in a 'style group', within a 'style group'.
    Steve

  • Varias búsquedas Grep Simultaneas con Script Indesign

    Hola quisiera saber existe o como puedo crear un script, tengo generadas varias búsquedas grep en indesign que utilizo en diferentes trabajos y algunas suman más de 30 las que debo utilizar en un mismo documento y me ahorraría mucho tiempo hacerlo en un solo clic!  Gracias de antemano!!
    Fabian
    PD: no tengo conocimientos de script...

    Esto es lo que ya he comentado en mi mensaje anterior, el script FindChangebyList se puede editar con bastante paciencia y cuidado, para incluir todas las búsquedas de cualquier tipo, necesarias.
    El problema surge cuando quiera aplicar y gestionar distintas combinaciones o cantidades de búsquedas.
    En el caso de Fabián parece ser elevado, por lo que le de nuevo le recomiendo:
    1. Que eche un vistazo al script de InDesign, mas concretamente al archivo de texto de soporte, adjunto captura, (puedes abrirlo es un .txt con ese nombre, situado en la carpeta de scripts, o usando el botón derecho para localizarlo desde el panel Scripts (Ventana>Utilidades>Scripts>Aplicación>Samples>JavaScript>FindChangeSupport>.....) y Mostrar en Explorer/Finder.
    El problema surgirá cuando necesite combinar diferentes búsquedas, entonces tendrá que crear varios archivos de texto con este nombre y tras añadirles un sufijo, guardarlos (preferiblemente) en esta carpeta y quitár ese sufijo al archivo que en cada momento necesite aplicar. Una gestión no excesivamente cómoda,por lo que debe ser él quien valore las ventajas apuntadas de la solución 2.
    2. Examinar la solución de Multi Find-Change (www.Automatication.com) y sopesar las ventajas o mejoras que puede suponer. Por cierto dispone de una versión de prueba limitada.
    Por cierto el autor Martinho da Gloria, dispone de otros scripts como SWFPresenter mu...y interesantes.
    Saludos
    Federico Platón
    Instructor Certificado Adobe InDesign CS5
    Instructor Certificado Adobe Illustrator CS5
    Instructor Certificado Adobe Photoshop CS5
    Instructor Certificado Adobe Digital Publishing

  • Create a GREP-Style with script? [AS] [CS4]

    Hi
    I'm trying to ad a grep-style to a paragraph style.
    It's easy to read/write properties from one that already exists but how can I create a new one?
    This is in applescript, CS4
    rgds /Mattias

    Yep, know about Nested Grep Style.
    In AS it:s http://www.indesignscriptingreference.com/CS4/AppleScript/nested-grep-style.htm
    If I have a P-style in a document, with a nested grep style applied. I can read and write to that grep style by calling it:
    nested grep style 1 of paragraph style "myParaStyle"
    read: grep expression of ... -- -- -- -- -- -- -- Where ... is the above line
    write: set grep expression of ... to "xyz"
    However, if the P-style doesn't have a nested grep style applied, I can't find a way to create/insert one into the P-style.

  • Find/Change GREP - FindChangeByList - help!

    Hi,
    Can anyone help with my GREP problem? I have a long unformatted list of products, I need a couple of GREP find and change queries to help format the list. The formatting will be based on paragraph styles for product header, description and product code. I have GREP working correctly to find the product code lines and apply the 'product code' paragraph style, but I'm struggling to target the product header line. The product header is on the next line after the product code, or it could be found on the line above the product description. I need GREP to find the product header to apply the product header paragraph style. I'm looking at using FindChangeByList; so far I have the folowing:
    grep
    {findWhat:"(Product Code|Product code)$"}
    {appliedParagraphStyle:"Product Code-green"}
    The above line finds all the Product Codes and applies the paragraph style. It works perfectly well from Indesigns Find/Change panel and FindChangeByList.
    But the next bit doesn't work:
    grep
    {findWhat:"^(?<=\\r)", appliedParagraphStyle:"Product Code-green"}
    {changeTo:"", appliedParagraphStyle:"Product Header-green"}
    I've tried to target the 'Start of a paragraph (^)' (this will be the product header) that has - 'Paragraph Break (\r)' with the 'Product Code-green' applied (this is the product code), in front of it. - (Am I right in thinking that in the FindChangeByList script I need 2 slashed on \\r - I have tried with 1 and 2 - no joy.)
    If I do this in Indesigns Find/Change panel it does kind of work. If I click find, it will find the correct point, and click change, it will apply the correct style to the product header - BUT if I click CHANGE ALL - it doesn't work. It reports '0' instances found, yet if i click Find again it will find the next instance. So it's kind of working on an individual click and find basis, but not on global change all - STRANGE? And it doesn't work at all when run from FindChangeByList.
    Anybody got any thoughts on why this is happening? or a better piece of GREP to try? Would really like it to be running from FindChangeByList. Hope the above makes sense.
    Thanks

    Hi,
    You can go straight or try to modify 'MultiFind' script.
    I suggest to use a text conditions and go straight with this code:
    var
              mDoc = app.activeDocument,
              mCond = mDoc.conditions.item("mFound"),
              mPath = "~/Documents/ID_words_to_find.txt",
              mDelimiter = ",",
              mSource = File(mPath),
              mOpen = mSource.open("r",undefined,undefined),
              len, len1, mWordsArr, mFound;
    if (!mCond.isValid)
              mCond = mDoc.conditions.add({
                        name: "mFound",
                        indicatorColor: UIColors.LIGHT_BLUE,
                        indicatorMethod: ConditionIndicatorMethod.USE_HIGHLIGHT,
                        underlineIndicatorAppearance: ConditionUnderlineIndicatorAppearance.SOLID
    if ( !mOpen) {alert ("Can't open a source file"; exit()};
    mWordsArr = mSource.read().split(mDelimiter);
    len = mWordsArr.length;
    app.findTextPreferences = null;
    while (len-->0) {
              app.findTextPreferences.findWhat = mWordsArr[len];
              mFound = mDoc.findText();
              len1 = mFound.length;
              while (len1-->0)
                        mFound[len1].appliedConditions = [mCond];
    app.findTextPreferences = null;
    How it works (should)?
    Assumed:
    - a list of words to find is in a .txt file as comma-delimited (you could set other delimiter)
    - this file is named 'ID_words_to_find'  and saved in user Documents folder (you can change mPath)
    Script define a condition 'mFound' and apply it to every word from your list found in a document. They are highlighted. You can modify them.
    Notice: to remove a condition (highlight) modify a word including a space before it.
    Enjoy:)
    Jarek

  • Shell Script to grep Job File name and Log File name from crontab -l

    Hello,
    I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l.
    #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1
    #40 17 * * * /home/oracle/refresh/refresh_ux634.sh > /home/oracle/refresh/refresh_ux634.sh.log 2>&1
    In crontab -l, there are many jobs, i need to grep job name like 'refresh_ug634.sh' and corresponding log name like 'refresh_ug634.sh.log '.
    I am thinking of making a universal script that can grep job name, log name and hostname for one server.
    Then, suppose i modify the refresh_ug634.sh script and call that universal script and echo those values when the script gets executed.
    Please can anyone help.
    All i need to do is have footer in all the scripts running in crontab in one server.
    job file name
    log file name
    hostname
    Please suggest if any better solution. Thanks.

    957704 wrote:
    I need help how to grep that information from crontab -l
    Please can you provide some insight how to grep that shell script name from list of crontab -l jobs
    crontab -l > cron.log -- exporting the contents to a file
    cat cron.log|grep something -- need some commands to grep that infoYou are missing the point. This forum is for discussion of SQL and PL/SQL questions. What does your question have to do with SQL or PL/SQL.
    It's like you just walked into a hardware store and asked where they keep the fresh produce.
    I will point out one thing about your question. You are assuming every entry in the crontab has exactly the same format. consider this crontab:
    #=========================================================================
    # NOTE:  If this is on a clustered environment, all changes to this crontab
    #         must be replicated on all other nodes of the cluster!
    # minute        (0 thru 59)
    # hour          (0 thru 23)
    # day-of-month  (1 thru 31)
    # month         (1 thru 12)
    # weekday       (0 thru 6, sunday thru saturday)
    # command
    #=========================================================================
    00 01 1-2 * 1,3,5,7 /u01/scripts/myscript01  5 orcl  dev
    00 04 * * * /u01/scripts/myscript02 hr 365 >/u01/logs/myscript2.lis
    00 6 * * * /u01/scripts/myscript03  >/u01/logs/myscript3.lisThe variations are endless.
    When you get to an appropriate forum (this on is not it) it will be helpful to explain your business requirement, not just your proposed technical solution.

  • Applescript 2 scripts to one (grep+add hyperlink)

    Hi.
    I try to combine two scripts. First one greps 7 digits numbers in indesign
    and another makes hyperlink that is same numbers as that selection(grep)'
    Does anyone have  idea how to do that. thanks -Jan
    This  greps 7 digits numbers in indesign with this script
    tell application "Adobe InDesign CS5.5"
      activate
              set find grep preferences to nothing
              set change grep preferences to nothing
              set find what of find grep preferences to "\\d{7}"
              tell active document
                        set myFoundItems to find grep
              end tell
    end tell
    and this one makes hyperlink:
    tell application "Adobe InDesign CS5.5"
              tell document 1
                        set mySelection to selection
                        set LinkID to contents of mySelection as string
                        set LinkIDURL to LinkID as string
                        try
                                  set URL_L to make hyperlink URL destination with properties {name:LinkID, destination URL:LinkIDURL}
                        on error
                                  set URL_L to hyperlink URL destination LinkID
                        end try
                        set URL_La to make hyperlink text source with properties {source text: (item 1 of mySelection), hidden:false}
                        set myHyperlink to make new hyperlink with properties {destination:URL_L, source:URL_La, visible:false}
              end tell
    end tell
    end

    YES! I got it with help of Indesign scripting quide.
    Here is the applescript. Feel free to use if you need. This only works if no hyperlinks are not assignet to those 7 digits you are grepping with this script
    tell application "Adobe InDesign CS5.5"
      activate
      -- resetoi grep opitonit ettei edelliset haut vaikuta
              set find grep preferences to nothing
              set change grep preferences to nothing
      --Asettaa haku parametrit
              set include hidden layers of find change grep options to false
              set include locked layers for find of find change grep options to true
      -- 7 numero perakkain hakuaehto
              set find what of find grep preferences to "\\d{7}"
              tell active document
      -- etsii jokaisen sivulla oleva mallikoodin nimen
                        set myFoundItems to find grep
      -- ottaa ylos jokaisen mallikoodin numerosarjan
                        repeat with i from 1 to (count myFoundItems)
                                  set FileName to contents of item i of myFoundItems
                                  if not (exists hyperlink URL destination FileName) then
                                            set TheH to make hyperlink URL destination with properties {name:FileName, destination URL:FileName}
                                  else
                                            set TheH to hyperlink URL destination FileName
                                  end if
      -- lisaa hyperlinkin
                                  set TheHSName to FileName
                                  set TheHS to make hyperlink text source with properties {name:TheHSName, source text: (item i of myFoundItems), hidden:false}
      make new hyperlink with properties {destination:TheH, source:TheHS, visible:false}
                        end repeat
              end tell
    end tell

  • Find/Change words (with GREP) and apply a style...

    I need a Script for Find/Change words with GREP, and apply a paragraph style...
    Thanks...

    Hi Marcos,
    If you want the script to create character styles: Bold , Italic, Bold Italic, etc, and replace local formatting with these styles, use scripts in post #3.
    But if you want find and change words, or/and replace local formatting with styles defined by you, use FindChangeByList script.
    If the latter, I recommend you to download and install Record Find Change script (written by Martin Fisher).
    Then choose settings you need in Find-Change dialog – make sure they work as expected – and run Record Find Change script. A Notepad/TextEdit file will pop up with a line containing the recorded setting. Copy it, open FindChangeList.txt, delete the contents of this file and paste the line you just copied (or add it to the bottom of the file).
    Repeat the process for all find-change operations you need.
    Finally run FindChangeByList.jsx to make all changes in one go.
    However, while using Record Find Change script, you may encounter a problem: it doesn’t record paragraph and character styles placed inside a group. But you can write references to such styles like so:
    appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Style Group 1"). paragraphStyles.item("Paragraph Style 1")
    Kasyan

  • Text or GREP find/change method to assign tags

    Hi all
    I could use a text or GREP find/change method to  assign tags to paragraph styles (for use in FindChangeByList), would anyone be able to help please?
    Steve

    Hi Peter
    I produce a quarterly magazine for which text is supplied in Word format.
    I currently run the 'FindChangeByList' script to format body text, headings, bulleted and numbered lists, web and email address text styling and to remove/correct all extraneous characters etc.
    Once the job is printed I need to produce a tagged 'accessible' readable (eg: read out loud function in Acrobat) pdf from the file, for text to speech readers.
    I am currently using the map tags to styles function, which allows me to assign tags which in turn gives me control of the 'text reading' order.
    What I'd like to be able to do is automatically apply the Tags to syles while processing the 'FindChangeByList' script.
    Steve

  • CS3 FindChangeByList error

    Greetings,
    I'm a pretty new ID user and am not an ID scripter, but I'd like to be able to use the FindChangeByList script. So I made myself a text file and ran the script (using the updated javascript script I found online dated 5/17/07. I'm running Windows XP Pro SP2 on a new Dell Optiplex 755 with 4gb RAM.
    The purpose of my attempt at using this script is to replace seven Greek acute accent glyphs with seven more pleasing glyphs from the same font.
    Here is the text of one of the lines from my text file:
    glyph {findWhat:"03AC"} {changeTo:"1F71"} {includeFootnotes:false, includeMasterPages:false,
    includeHiddenLayers:false, wholeWord:false}
    find bad acute vowel and replace with good one.
    And here is the error message I got.
    JaveScript Error!
    Error Number: 33801
    Error String: Invalid Find Font
    Line: 205
    Source: var myFoundItems = myObject.changeGlyph();
    I didn't make any changes to the jsx file.
    Any ideas or suggestions would be greatly appreciated.
    Phil Frank

    I bet you are confusing glyphs with unicodes.
    The Replace Glyphs option is to replace "glyph #10234" in some font with "glyph #584". This can be useful, say, to replace one style of arrow in Minion Pro with another (where both have the same Unicode but different glyph numbers).
    In your example you mention "2018" and "2019", with a comment to two single quote characters. Those are not glyph indexes, but Unicodes! So you cannot use the Glyphs option, you should use either the regular find/change or GREP -- whatever works best.
    (The notation of unicode characters is slightly different for regular and GREP, so you'd better double check what you are going to use.)

  • FindChangeByList bug?

    Hello,
    I'm using grep searches in the FindChangeByList script and this one line doesn't seem to work for some reason :
    grep {findWhat:"(?<=\w)[!?;»%$¢°]"} {changeTo:"~<$0"}
    But if I copy paste the info in the normal Grep Find / Change dialog, it works.
    I'm trying to find any !?;»%$¢° characters preceded by a letter or a number and add a thin space before it.
    {findWhat:"\s(?=[!?;»%$¢°])"} {changeTo:"~<"}
    I use this line to change any existing space preceding those signs and convert it to a thin space and it works.
    Any ideas? Are there differences in the way I should type my expressions in the find/change grep dialog vs. adding them to the FindChangeByList script? Or maybe the way I typed my expressions is not efficient, I'm quite new to this!
    Thank you for your time,
    Emilie

    So if I wanted to search for a slash in ID, I would need to espace it by typing another one \\
    Yes -- but only in GREP. In the regular Text Search box, it's not a "special" character. (But the ^ is, and to search for a ^ you have to insert two.)
    and if I were to do this in Javascript, do I need to type three \\\ to escape just the beginning of the thing or four \\\\ to escape both of them?
    Four Each 'escape' character only acts on the character immediately after it. So "\\\Hello" would be translated to one backslash, followed by a "\H" code (whatever that may be), followed by "ello".
    I guess learning some Javascript would help :-)
    This -- adjusting the FindChangeList file -- is as far as a lot of people dare to go. You already crossed an invisible border by asking, "what goes wrong here?" where others would simply have shrugged it off as "it dont work" and do it manually instead.
    Think of something you might want to script, give it a try (there are lots of good beginners' JS web pages) and post here if you get stuck!

  • GREP question re: character style

    I am trying to take a block of text and change everything in that text to a certain character style. What's the correct GREP expression to do that? I know I could just highligh the text in question and apply the character style, but I need to use this in a FindChangeByList script, so I need to do it using GREP expressions. Thanks.

    What I'm really looking for is this. When I want to format a paragraph in a paragraph style, sometimes there are underlying character styles that I need to clear first. So I higlight the block of text, go to character styles and select [None], thus clearing that text of any character styles. Then I apply my paragraph style. I've found that if I don't do this, I get unexpected results.
    I know that the active characer styles is always the last character style that was used, but I wish that the default was simply the [None] character style. I'm forever having to go back to [None.]
    I'm trying to build some scripts that automate this for me, but perhaps there's a much easier way to think about this problem.
    Message was edited by: JoJo Jenkins

Maybe you are looking for