Grep scripting bug?

The following grep search works fine from within Indesign (finds all prices that don't have the "€" symbol at the end):  ((\d+)?(\.?))+(\d{1,3}),(-)?(\d+)?(?!(.*)?(€))  If I try to translate the same search expression into a script, it doesn't work anymore:  ((\\d+)?(\\.?))+(\\d{1,3}),(-)?(\\d+)?(?!(.*)?(€))  How could this be possible? Am I doing something wrong or is it a bug of the software?  Any suggestions would be much appreciated  Thanks in advance

CS 5.5 win7
works here!? perhaps a mistake in scriptimplementation?
app.findGrepPreferences=app.changeGrepPreferences=null;
app.findGrepPreferences.findWhat="((\\d+)?(\\.?))+(\\d{1,3}),(-)?(\\d+)?(?!(.*)?(€))";
toFind = app.activeDocument.findGrep();
alert(toFind.length)

Similar Messages

  • Grep script that looks for paragraph style A followed by paragraph style B

    Hello,
    I am fairly new to scripting in Indesign and I have run across something I want to script that I don't know how to do. Two of the paragraph styles that are in our files are Normal and Song. I need to add an extra paragraph return between all instances of Normal followed by a Song. I tried to search the forums to see if this was already on here somewhere and if it is I didn't come across it. I would like to set it up as a grep script but if anyone has an alternative way to do this I would like to know also.
    Thanks in advance

    Hi,
    So you could use a script.
    I assume a text frame with proper story is selected and whole story is in one frame or linked frames.
    myStory = app.selection[0].parentStory;
    if (myStory.constructor.name !== "Story")
         alert ("Select a destination text frame, pls\rand try again");
         exit();
    myNormal = app.activeDocument.paragraphStyles.item("Normal");
    mySong = app.activeDocument.paragraphStyles.item("Song");
    app.findTextPreferences = null;
    app.findTextPreferences.appliedParagraphStyle = mySong;
    mFound = myStory.findText();
    len = mFound.length - 1;
    if (len >= 0)
         while (len--)
         currPara = mFound[len].paragraphs[0];
              if (myStory.paragraphs.previousItem(currPara).appliedParagraphStyle == myNormal)
              currPara.insertionPoints[0].contents = "\r";
    rgds

  • Script bugs for Oracle8i Sun system

    No Sun Platform forum so posting here,
    let me know if there is a better place.
    I have found script bugs that I fixed
    for the Oracle8i sun enterprise server.
    1) dbora - used for startup and shutdown
    of database, calls dbstart and dbshut.
    2) dbstart - script contains errors:
    "/PL\/SQL" does not exist in the svrmgrl version output information,
    they would be better off storing the version info in a file somewhere during install, like /var/opt/oracle like they do other files.
    Must have changed the output of that program for 8.1.
    My fix above checks for the 'Oracle8i Enterprise Edition Release' output.
    Let me know if someone would like to get
    a copy of my take-off scripts.
    null

    Yes I would like a copy .... thank you!

  • CS6 scripting bug / Problème scripts d'action CS6

    Bonjour, suite à mon passage de la CS4 à la CS6, mes scripts d'action ne marchent plus.
    Ce script par exemple :
    Hi folks, going from CS4 to CS6 made my action scripts bug, especially those using pathfinder :
    divide / ungroup / default /  trim / ungroup / copy / paste in front
    Ces actions effectuées une à une donnent un résultat normal mais conduisent donnent une série de messages d'erreur une fois enregistrées dans un script :
    These actions do work normally when i perform them separetly but fail as soon as i record it in a script. Does anyone has an idea?
    C'est la même chose avec ou sans fond, avec ou sans contour. Ce même script fonctionne très bien sur CS4. Les raccourcis clavier sont les mêmes.
    HELLLLPPPPP!!!!!

    Bonjour, n'ayant jamais été confronté au problème, je suis allé regarder si la question avait été traitée en anglais.
    Mylenium a proposé une explication sur l'accès à certains ports du système.
    En fait pour lire une vidéo, Photoshop a besoin de créer un accès à ce fichier, en interne, si ces ports sont inaccessibles (bloqués par une appli tierce, antivirus, firewall (ou pare-feu) ou occupés par d'autres applications), cela peut échouer.

  • I am having a scripting bug.

    I picked this project up from a friend, trying to solve a bug he is having but I can't figure it out.
    The project is built around scripting which as it turns out, I don't know that well. Whenever you select the slideshow and then hit the menu button, it brings you back to the menu. Then, if you hit the menu button again, it brings you back to the last still you were viewing. If this project was built without scripting I could figure it out but I'm lost.
    Here is the log from the actions of my problem. The italicized text is the actions from viewing the slideshow and the bolded text is what happens after I hit the menu button and encounter the bug.
    User activated: Special Features button
    Executing Pre-Script: Special Features pre-script
    1 mov GPRM 7, 2
    GPRM 7 register changed: 2
    Default button selected: Button 2
    SPRM 8 (Highlight Button) register changed: 1024
    Jumping to Menu: Special Features 2 - Button 2
    SPRM 8 (Highlight Button) register changed: 3072
    SPRM 8 (Highlight Button) register changed: 2048
    +User activated: Button 3+
    +Jumping to (null): (null) - KFJProduction_StillFrame.jpg+
    +SPRM 6 (Title PGC) register changed: 1+
    +SPRM 4 (Title Number) register changed: 5+
    +SPRM 5 (VTS Title) register changed: 1+
    +SPRM 7 (Part of Title) register changed: 1+
    +SPRM 3 (Angle Number) register changed: 1+
    +User action: Next chapter+
    +Jumping to (null): (null) - Joe_PrivateEye.JPG+
    +SPRM 6 (Title PGC) register changed: 1+
    +SPRM 4 (Title Number) register changed: 5+
    +SPRM 5 (VTS Title) register changed: 1+
    +SPRM 7 (Part of Title) register changed: 2+
    +SPRM 3 (Angle Number) register changed: 1+
    +User action: Next chapter+
    +Jumping to (null): (null) - FataleandPlantman.JPG+
    +SPRM 6 (Title PGC) register changed: 1+
    +SPRM 4 (Title Number) register changed: 5+
    +SPRM 5 (VTS Title) register changed: 1+
    +SPRM 7 (Part of Title) register changed: 3+
    +SPRM 3 (Angle Number) register changed: 1+
    *User action: Menu*
    *Jumping to Script: Main Menu loop point*
    *Executing Script: Main Menu loop point*
    *1 Jump Main Menu 1::Scene Selction Button(Loop) if (GPRM 7 = 1)*
    *2 Jump Special Features 2(Loop) if (GPRM 7 = 2)*
    *Executing Pre-Script: Special Features pre-script*
    *1 mov GPRM 7, 2*
    *GPRM 7 register changed: 2*
    *Default button selected: Button 2*
    *SPRM 8 (Highlight Button) register changed: 1024*
    *Jumping to Menu: Special Features 2 - Button 2*
    *User action: Menu*
    *SPRM 6 (Title PGC) register changed: 1*
    *SPRM 4 (Title Number) register changed: 5*
    *SPRM 5 (VTS Title) register changed: 1*
    *SPRM 7 (Part of Title) register changed: 4*
    Can anyone help me?

    It isn't a bug... it is working exactly as it should do. This is a well known feature of DVDs, in that the menu button also acts as a resume button if there is resume info stored by the DVD player. To get that info stored, you only have to view a track. Since a slideshow is a special case of a track, there is resume info stored when you view it.
    This is nothing to do with your scripting, or anything except the DVD specifications. All discs will work this way.
    Where did you expect the second menu press to take you? To a different menu? In order to do that you have to have a button on your first menu that takes you to the other.

  • Scripting bugs and anomalies in Acrobat Pro XI

    I've downloaded the trial version of Acrobat Pro XI and starting testing it out with various scripts and actions. The results are far from good, I'm afraid.
    Here are some of my findings, so far:
    1. The Action Wizard is very cumbersome and un-intuitive. It took me several minutes to figure out how to change the default setting to a specific folder, and I still can't find where to select the input file types to be processed. Also, what's the relation between the "Default option" and the Add File and Add Folder buttons? Very strange UI decisions there. I don't care about panels and dividers, but I do want the actual commands to make sense*.
    2. Another very bad decision is moving the Save command to a different section. What's the point of making it just another "tool" in the list? If you want to use it, you'll want to use it at the end of the process, not somewhere in the middle... And as it stands now, if you don't add it explictly, the changes are not saved at all.
    3. After running an Action, some of the files remain open in the window. I was looking for a Close File command, but couldn't find any such thing. Is this a bug?
    4. I'm running a script that processes some files. After finishing, the files are automatically saved and overwritten, even though I haven't added that command yet to my script. Very serious bug!
    5. After running some scripts and actions, working with hidden files, I've tried to access app.activeDocs. The result was an infinite loop of this error message:
    After a while I had to close down Acrobat from the Task Manager.
    I must say I'm very disappointed with this release, so far, and would not recommend anyone to upgrade to it.
    * Speaking of commands that don't make sense, what's the point of the Document JavaScripts command in the Action Wizard? All it does is open that window... This doesn't make sense at all in an automated action. It should have given you the option to automatically embed a piece of code in a file, not let you do it manually.

    Hi there,
    Your feedback is interesting as this is the very first time we receive some negative feedback about Actions in Acrobat XI.
    First of all what do you mean by "what's the relation between the "Default option" and the Add File and Add Folder buttons" ?
    If don't have the time to go through the help nor documentation here a brief answer:
    - Default option allows the author of an action to specify the behavior and settings for the command. In the case of Add File and Add Folder it will drive user running the action about the type of location the file(s) should be retrieved from: a scanner, cloud repository, a specific folder, etc. This is a bit of improvement over Acrobat X, but not a significant change in the behavior.
    I hope this is what you were questionning about.
    "Another very bad decision is moving the Save command to a different section"
    While this may not be convenient for you, I don't think it's enough to state that it's been a very bad decision since most users like it. It's also more flexible and more powerful. It makes it possible for instance, to save a document with a different naming convention at different points of the action which is an important improvement for some users. I am sure that after you've played with it a little bit more you will agree with that.
    "After running an Action, some of the files remain open in the window"
    Files that have been loaded by the Action playback should be closed, unless that have something special. Otherwise it could be a bug.
    " I'm running a script that processes some files. After finishing, the files are automatically saved and overwritten"
    It can only be because the JavaScript contains instructions to save the files, or the Action does. Otherwise it would be a bug and I'd be curious to know more about it as Acrobat is VERY robust about this.
    Please provide the files in question I'll be happy to spend time debugging the case.
    "After running some scripts and actions, working with hidden files, I've tried to access app.activeDocs. The result was an infinite loop of this error message:"
    This is out of my scope and will ask around me how it's supposed to work. Hopefully we'll get an answer from the script folks quickly.
    Please share files and way to reproduce the issues you meet, considering that you are the first person to provide such negative feedback there might be some misunderstanding somewhere.
    Best,
    Luc Leroy

  • Possible scripting bug

    I have a script that searches and replaces the characters <br> with \r\n
    It works fine in cs3 - cs5.5
    In cs6 the script inserts 2 new lines (one for the\r an one for the \n)  This seems like a bug as \r\n should result in a single new line (unless I'm missing somethimg)
    Mike Cardeiro
    Editor/Animator/Compositor                 
    D4 Creative Group - Philadelphia, PA    
    215-483-4555                
    Resume | samples                       
    http://www.michaelcardeiro.com/resume/

    It sounds like you need to convert the linefeed to Windows-style.  Insert this before you start writing lines:
    txtFile.lineFeed = "Windows"; //convert to Windows linefeed
    Or you can determine what kind of linefeed is in the document and then use that as a basis for conversion:
    if (txtFile.lineFeed === "windows") {
        newLine = "\r\n";
    } else {
        newLine = "\n";

  • Scripting  bug in the background?

    Hi
    A few weeks ago I read a post by Alan_AEDScripts about Killing windows (palettes) and  that
    seems to be true. I´ve  been testing some scripts and  I found that Functions are also keept in memory even after the function ends
    This is a simple window (dialog) tester  with 10 buttons.
    function dummyWin(){
        var win = new Window("dialog","Dummy Window",undefined);
        for(var i = 0 ; i < 10;i++ ){
            win.add("button",undefined,"Tester");
            win.children[i].onClick = function(){win.close();}
        win.show();
    dummyWin()
    Before I run it After Effects memory allocated is
    and  after I run tester script 20 times After effects memory increases in almost 3 megs.This is more visible with windows that has more features and have to be open and close a lot of times.
    It seems to be that the same thig happens with ScriptUI Panels
    I have a more complex script that when a I run it it increases  almost 2 megs to the memory allocated by AE  every time I run it .I tried  a lot things but unfortunately memory keeps increasisng  
    Maybe I am the only one who is experiencing this issue.if not this is serius bug that
    should be solved right away.
    All tests were done in AE CC. Please give it try
    Sorry for my English

    Hi
    A few weeks ago I read a post by Alan_AEDScripts about Killing windows (palettes) and  that
    seems to be true. I´ve  been testing some scripts and  I found that Functions are also keept in memory even after the function ends
    This is a simple window (dialog) tester  with 10 buttons.
    function dummyWin(){
        var win = new Window("dialog","Dummy Window",undefined);
        for(var i = 0 ; i < 10;i++ ){
            win.add("button",undefined,"Tester");
            win.children[i].onClick = function(){win.close();}
        win.show();
    dummyWin()
    Before I run it After Effects memory allocated is
    and  after I run tester script 20 times After effects memory increases in almost 3 megs.This is more visible with windows that has more features and have to be open and close a lot of times.
    It seems to be that the same thig happens with ScriptUI Panels
    I have a more complex script that when a I run it it increases  almost 2 megs to the memory allocated by AE  every time I run it .I tried  a lot things but unfortunately memory keeps increasisng  
    Maybe I am the only one who is experiencing this issue.if not this is serius bug that
    should be solved right away.
    All tests were done in AE CC. Please give it try
    Sorry for my English

  • Replacing the info in the GREP script to run a bunch of functions at one time

    Hello,
    I have created a new JavaScript, by saving the script called "FindChangeByList.jsx" and giving it a new name, and replacing the text file with my new one, which is just a copy of the original with my one change.
    I am trying to make my script do 2 functions that I use often, and I am already stuck on the first one.
    grep {findWhat:"\d+:\d+\t"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.
    I am trying to find any digit one or more times, followed by a colon, followed by any digit one or more times, followed by a tab aand replace it with nothing.
    does anyone know what I have wrong in this file?
    thanks
    babs

    HI John,
    OK-the puzzle gets more perplexing.
    You are right, the examples do not escape out the backslash and they work fine.
    So, I took ours, and removed one additional backslash at time to see if it was one in particular, and guess what? I removed all 3 and it worked?
    BUT!!!! and there is a big but here....after the answers here that made it work, I continued with my request by adding a second line of code to follow.
    Here is the second line of GREP after the one I had questioned.
    grep    {findWhat:"\r"}    {changeTo:" "}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all returns followed by a tab character and replace with single returns.
    When I put the double backspaces in, it was fine by itself, so, then I added this second line and all was still fine.
    So, after reading your comment this morning, I removed the additional backslashes (one at a time) and it still worked. (I thought maybe, it was one in particualr giving me grief.)
    So, I removed that second line of code, and left it as I had it during my original post, one backslash, and guess what, it didn't work?
    Conclusion thus far: Without that second GREP request, the line before it  only works, if you have the escaped out the backslashs..once I put the second line back in, the first line works with just single backslash's???
    Talk about strange?? huh???
    any thoughts????
    babs

  • SAP GUI Scripting  bug?

    Hi there,
    I developed a custom transaction with only one very simple screen. I disabled the application toolbar in the screen settings (checked "Without Application Toolbar"). But when I start SAP GUI via Scripting API, the application toolbar is always shown. I wonder is this a bug or by design?
    Does anyone know the work around for this? It's a real show stopper for me
    Igor

    Hi Gunnar,
    if You log via myProgram.exe to SAP, then SAP GUI is running in so-called classical design. This also appears to selected design, if the following to be set:
    START -> All programs -> SAP Front End -> SAP GUI Configuration -> Applications -> Add -> myProgram.exe -> Open -> OK-Button
    Regards,
    ScriptMan

  • With grep script help

    from the image processing with the script can we do

    only the selected text do how should I write command to
    app.findGrepPreferences = app.changeGrepPreferences = null;      
    app.findGrepPreferences.findWhat = "(.+?)~f(.+?)~f(.+?)\r\s+(.+?)\s\s+(.+)";
    app.changeGrepPreferences.changeTo ="$1\t\t$2\r$3\t\t$4\r$5";
    app.activeDocument.selection[0].changeGrep(); 
    app.findGrepPreferences = app.changeGrepPreferences = null;

  • Script bug is trying to steal account information....

    A script run on error is occurring upon loading... The system often displays my account log in information in the window or scrolling bar at bottom of screen....

    Timskey wrote:
    Someone is trying to hack my apple account
    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team..

  • SGD 4.5.907 Installer script bug when ttaserv/ttasys has /bin/tcsh shell

    When trying to install SGD 4.5.907, I kept getting this error, even though the two users were properly defined:
    ===============================================================================================
    ## Executing preinstall script.
    ERROR: Required users (ttaserv and ttasys) are not correctly defined.
    Setup will now exit.
    You must create two user accounts before you can install Secure Global Desktop.
    - The user names must be "ttaserv" and "ttasys".
    - Both must have their primary group set to "ttaserv".
    - You can use any UIDs and GID you want.
    - Both users must have a valid shell, for example /bin/sh.
    - Both users must have writeable home directories.
    - We recommend that you lock the user accounts (passwd -l).
    ===============================================================================================
    After searching for the actual pre-install script and figuring out how it works, I saw the test for user accts and realized it didn't account for a "valid shell" like /bin/tcsh, since it was using an sh/bash type of test construct.
    If you want to argue whether or not TCSH is a valid shell, be my guest, but the installer should either handle the shell or the error msg should be a little more clear like "SGD requires an SH, or BASH type shell"

    @JRoesler :
    The script for installing the users during installation when the users are not created is included some version before the 4.50.907
    The SGD version here is only 1 minor version before the latest release.
    @aspenhedge:
    If I look into the rpm (for Linux install) I don't see a check for a valid shell. It does however try to 'su' into those accounts. I might be wrong in this one.
    Can you manually use 'su ttaserv' and 'su ttasys' without any problem? Do these users have a valid home-dir for example.
    - Remold

  • How to apply style with grep script to finding question mark

    app.findGrepPreferences = app.changeGrepPreferences = null;      
    app.findGrepPreferences.findWhat = "\?";
    //app.findGrepPreferences.SpecialCharacters = SpecialCharacters.QUESTION_MARK;
    app.findGrepPreferences.appliedParagraphStyle = "myParS";
    app.activeDocument.changeGrep(); 
    app.findGrepPreferences = app.changeGrepPreferences = null;

    Put one more "\" in front of "?".
    and to appy "myParS" style,
    app.findGrepPreferences.appliedParagraphStyle = "myParS"; this line should be changed to app.changeGrepPreferences.appliedParagraphStyle = "myParS";

  • Major Script Bug

    I'm using javascript on indesign cs4 to automate making a few hundred page long document. I've used this particular method for many other things recently wtih no problems at all. Basically, I will place a name into a text frame on a template and move it to a new page and repeat with the next name in the list. I've never had any problems with the move function, but now each time it moves to a new page it also moves down about a point, which is a problem when you have a few hundred pages, the final name and frame have moved about half an inch. The frame on the template (the first page) has also moved as much as the one on the last page. Any help is really appreciated.

    My approach to this situation would be to simply do it in two steps:
    1. Duplicate the object to the new page.
    2. Move the object to where I want it.
    Granted, it looks as though the second step ought not to be necessary, but this is the easy way to put this issue to bed.
    Dave

Maybe you are looking for

  • Tecra S1 video out does not work

    Hi, I tried to connect my TS1 via cinch to a beamer. Unfortunately because of other reasons I can not use VGA. However I do not get any signal at all. I tried nearly everything. I installed Windows XP with Toshiba Recovery CDs again, but it does not

  • Sql loader in procedue

    hi, i have a a data file and a control file as follows data file(data.txt) 7782, "Clark", "Manager", 7839, 09-June-1981 7839, "King", "President", , 17-November-1981 7934, "Miller", "Clerk", 7782, 23-January-1982 7566, "Jones", "Manager", 7839, 02-Ap

  • Help recovering a locked file!!

    I massively messed up yesterday with my InDesign CS3 files. I connected my Macbook to the server at work and I was working on multiple IDD documents from the network in this book. I left for the day without saving and closing all IDD windows. So when

  • How to Buy Mixes for others

    If I create a playlist in the iTunes store and want to act as a middle man for people who want to purchase it (they either dont have broadband or just dont want to bother with it), am I allowed to buy multiple copies of this playlist and burn it for

  • Table for storage location addresses

    Hi I am trying to find the table where addresses for storage locations are found. I have found the storage locations in T001L and the addresses in ADRC, but cannot find the link between these tables. In which table can I find the link between storage