GREP with the Javascript vs find/replace dialog box

InDesign CS4

Search/replace, GREP tab dialog box

To find:

(www: http\:-/-/) ([\w\-\?\=\&]+[\.\/]?) +

This expression finds links pretty well.

When I put in a .jsx file and fire in the actions palette, it does not work.

The following works, but obviously does not correspond to as many hypertext links:

http\:\/\/([\w\-\]+[\.\/]?) +

as in

([app.findGrepPreferences.findWhat = ' http\:\/\/([\w\-\]+[\.\/]?) +';

I tried to add?,-?, and? but it bombards the - no match.

Same with initial either / or between http as the beginning of the pattern and www.

I wonder if a grep javascript guru could give me a clue as to how to translate it?

Thank you.

Hey!

Definition of GREP via JavaScript needs to use to escape. If your GREP in JS expression would look like this:

app.findGrepPreferences.findWhat = "(www|http\\:\\/\\/)([\\w\\-\\?\\=\\&]+[\\.\/]?)+";

Hope that helps.

--

tomaxxi

http://indisnip.WordPress.com/

Tags: InDesign

Similar Questions

  • Find/Replace dialog box is missing

    When I choose "find/replace" dialog box does not appear. It's in my taskbar, but I can't seem to make it appear on my screen. I tried to change the layout of the workspace and even remove my configuration file nothing helps. Help, please!

    I deleted the registration according to the technnote below key and that seems to work.

    http://www.Adobe.com/go/36bda422

    Thank you.

  • Disappeared from the Find/Replace dialog box

    Hello. Find/replace is not dimmed, but the dialog box won't appear on the screen. Does anyone have a solution? Thank you!

    InDesign CC 2015.1 (Build 11.1.0.122).

    OSX 10.10.5 Mac Pro (mid-2012)

    I just removed the search panel and change plug-in in the plug-ins folder of text and then dragged it back to the and who brought. Thanks for your time, Steve.

  • I can't navigate and select with the mouse in some ID dialog boxes

    I recently installed ID CC 9.1X64 on a PC running Windows 7 Professional with SP1.

    The application seems to work OK in regard to most but when some dialog boxes (for example Options of cell Style) pop up I cannot select items or navigate around the area by clicking with the mouse. I have to use the tab and return keys, which is awkward and done things, such as the definition of the outline styles, almost impossible.

    Does anyone have any idea why this might be happening? I had something similar with another application.

    Malcolm

    It is the following: panels and InDesign tools answer not to the clicks of the mouse (Windows 7/Vista)?

  • How can I open the "Convert to indexed colors" dialog box with custom presets?

    Hello

    I need to automatically open the "Convert to indexed colors" dialog box in Photoshop. Before and after that I have a few scripts that are running, so it is not possible to open the dialog manually. Also, I want to put some custom presets (like the number of colors, etc.).

    Find something similar to what I want for the color range selection (opens the dialog with the presets you put in that):

    function colorrange(enabled, withDialog, fuzziness) {
        if (enabled != undefined && !enabled)
          return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        desc1.putInteger(app.charIDToTypeID('Fzns'),fuzziness);
        var desc2 = new ActionDescriptor();
        desc2.putDouble(app.charIDToTypeID('Lmnc'), 31.22);
        desc2.putDouble(app.stringIDToTypeID("a"), 0.86);
        desc2.putDouble(app.stringIDToTypeID("b"), 0.31);
        desc1.putObject(app.charIDToTypeID('Mnm '), app.charIDToTypeID('LbCl'), desc2);
        var desc3 = new ActionDescriptor();
        desc3.putDouble(app.charIDToTypeID('Lmnc'), 95.34);
        desc3.putDouble(app.stringIDToTypeID("a"), 54.59);
        desc3.putDouble(app.stringIDToTypeID("b"), 49.85);
        desc1.putObject(app.charIDToTypeID('Mxm '), app.charIDToTypeID('LbCl'), desc3);
        desc1.putInteger(app.stringIDToTypeID("colorModel"), 0);
        var desc4 = new ActionDescriptor();
        var desc4 = executeAction(app.stringIDToTypeID('colorRange'), desc1, dialogMode);
      };
    

    How can I get the same thing for the indexed color conversion dialog box? Apart from doing a lot of guessing about the stringIDs.

    Is there some kind of "table of choice" for char and string ID?

    Guys thank you very much in advance! This forum has been a great help on several occasions.

    OK never mind I got it, stupid me.

    He has recorded with Listener Script and changed the "DialogMode" parameter of the function of executeAction "DialogModes.No" at "DialogModes.All".

    var idCnvM = charIDToTypeID( "CnvM" );
                var desc249 = new ActionDescriptor();
                var idT = charIDToTypeID( "T  " );
                    var desc250 = new ActionDescriptor();
                    var idPlt = charIDToTypeID( "Plt " );
                    var idClrP = charIDToTypeID( "ClrP" );
                    var idSele = charIDToTypeID( "Sele" );
                    desc250.putEnumerated( idPlt, idClrP, idSele );
                    var idClrs = charIDToTypeID( "Clrs" );
                    desc250.putInteger( idClrs, 4 );
                    var idFrcC = charIDToTypeID( "FrcC" );
                    var idFrcC = charIDToTypeID( "FrcC" );
                    var idNone = charIDToTypeID( "None" );
                    desc250.putEnumerated( idFrcC, idFrcC, idNone );
                    var idTrns = charIDToTypeID( "Trns" );
                    desc250.putBoolean( idTrns, false );
                    var idDthr = charIDToTypeID( "Dthr" );
                    var idDthr = charIDToTypeID( "Dthr" );
                    var idDfsn = charIDToTypeID( "Dfsn" );
                    desc250.putEnumerated( idDthr, idDthr, idDfsn );
                    var idDthA = charIDToTypeID( "DthA" );
                    desc250.putInteger( idDthA, 75 );
                var idIndC = charIDToTypeID( "IndC" );
                desc249.putObject( idT, idIndC, desc250 );
            executeAction( idCnvM, desc249, DialogModes.ALL ); //Change from NO to ALL
    
  • Cannot process the request because a modal dialog box or the alert is active

    I can't work for the life of me why I get this message when "cannot process the request because a modal dialog box or the alert is active. I simplified my code to reproduce the problem.

    All I want to do is have a dialog box that allows me to edit items on the page... But it does not seem to allow it. I must be missing something simple.

    var selection = app.activeDocument.selection[0];
    
    dialog = new Window('dialog');
    
    var button = dialog.add('button', undefined, 'Resize');
    
      button.onClick = function() {
    
      selection.geometricBounds = [0, 0, 10, 10];
    
    };
    
    dialog.show();
    

    If you use 'dialogue', then you must leave the modal state to interact with the app was done by closing the dialog box.

    var w = new Window('dialog');
    var v = w.add ('edittext');
    var b = w.add('button');
    b.onClick = function(){
        w.close(1);
    }
    if (w.show()==1) alert (v.text);
    

    Or switch to modal MOM like brother suggested dialog boxes...

    Loïc

    Ozalto | Productivity-oriented - Loïc Aigon

  • Where is the location of the AI CS4 plugin filter dialog box?

    Hi all

    IM using CS4. In the CS4 SDK sample projects, "Tutorial" is a type of filter plugin, and I want to test this plugin.

    Project is compiled correctly and created plugin. Placed this plugin in the plugins of the AI folder.

    and then started to HAVE. The plugin tutorial shows under object-> filter-> SDK-> tutorial

    I clicked on "Tutorial" plugin from the menu filters. A dialog box is open. the value of some parameters in the user interface, and then click OK.

    The dialog box disappears after clicking on the OK button.

    now, how can I get the dialog ('Tutorial') same again? Where can I see the "Tutorial" dialog in artificial intelligence?

    As if we apply a 3d rotation effect, then the 3-d rotation dialog box is visible in the appearance Panel. If we want to change the settings, we can click "3-d rotation" in the appearance Panel, then the 3-d Rotation dialog box will be opned.

    Please tell me.

    -spirit

    Depending on what your filter (that is, if it leaves an effect or if it changes only the art), he can add a message in the appearance Panel. It is generally for the 'effects' no filters, although the distinction is somewhat blurred. One of the reasons why they took the menu filters in CS4 is because most of the "filters" were actually just the art operations and better adapted to be placed as menuitems in more appropriate places. The effects really are pieces of code that are returned when necessary on the art of change their representation on the settings page.

    If you just do something art once (like the simplification of the art, or reflecting the art) so you're not an effect. If this is the case, you can create just one menuitem anywhere you feel is right, if you do not want to be locked in the object > filter. Being a filter is not really give you a lot more more. You can simply create a menuitem, respond and do your job. The filters come with luggage as parameters of filter and 'fire last filter' and whatnot, and frankly, which is phased out. Its more a concept shoehorned in Illustrator Photoshop.

  • How to refresh the current page after the return of a contextual dialog box?

    Hello

    In jdev 11.2.3,

    In a jsff page, I have a commandbutton control to start a dialog popup and actionListener like this:

    < af:commandButton text = "Select Bills" id = "cb1" actionListener = "#{newReceiptBean.refreshBillPending}" >

    < af:showPopupBehavior popupId = "p1" / >

    < / af:commandButton >

    or

    < af:commandButton text = "Select Bills" id = "cb1" actionListener = "#{newReceiptBean.refreshBillPending} '"

    action = "#{newReceiptBean.refreshBillPending}" >

    < af:showPopupBehavior popupId = "p1" / >

    But the 'newReceiptBean.refreshBillPending' method can be run even if it can be executed by another button like this:

    < af:commandButton text = "ExecuteWithParams."

    Disabled = "#{!}" bindings. ExecuteWithParams.enabled}"id ="cb3 ".

    action = "#{newReceiptBean.refreshBillPending}" / >

    How to run a bean method, after the return of a pupup dialog box?

    Thank you!

    Post edited by: BAO. SZ It seems after setting showPopupBehvior for the button, 'action', and "actionListener" cannot be performed more. Can someone give any help? Thank you.

    I'm not sure that clearly understand your requirment. But have you all ok or cancel button in your popup?

    Well, you can use diaglogListener in your popup if you use dialog.in your dialoglistener runs your bean method.

    see this example

    Handling Ok and the button cancel in af:dialog to context-sensitive help in Oracle ADF by dialogListener | Techartifact

  • Get NaN with the Javascript variable

    Hi all

    I'm learning javascript and I'm having a problem. I can't use a variable in javascript correctly. The function below shows the problem. When I use the variable vRow gets my value, however when I try to use the link_line variable I get NaN in my field in a table (f37).

    Can someone identify the problem here? I tried everything, including parseInt, parseFloat conversions, but I can't understand what is wrong.

    Thanks for your help!
    <script>
    function f_ValidateLinkLine(pThis) {
        
       // The row in the table
     var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
    
      // A value entered by user in tabular form on this row
     var link_line = parseInt(html_GetElement('f20_'+vRow).value);
      
         // Set the value for f37
     
        // This works!
        html_GetElement('f37_'+vRow).value = parseFloat(html_GetElement('f01_'+vRow).value);
    
        // This puts NaN in my field! Why?
        html_GetElement('f37_'+vRow).value = parseFloat(html_GetElement('f01_'+link_line).value);
     
        } // End ValidateLinkLine
    
    </script>
    Published by: blue72TA on August 12, 2011 12:09 AM

    Hmmm... Is it possible that it's to do with the naming convention for item IDs tabular?

    I have the feeling that the reason why your call to

    alert( html_GetElement('f01_'+link_line).value )
    

    Returns "undefined" is perhaps because the item you are looking for is actually called something like:

    F01_0001
    

    So if you simply concatenate F01_1, of course I don't think he'll find something with this specific ID (even if from a semantic point of view, that's what you intend). Try the same test, except F01_0001 hardcode in his place, I think you'll probably have a more fruitful response.

  • Select with the javascript function

    I need to create a purchase order that allows to calculate the cost of printing using one-sided or two-sided. My problem is that this code can use only the cost of single_side in the function. The function must use two side cost if "DUP" checkbox is disabled. What I read javascript does not provide a way to access the selection list as if it were a table. (Where I can identify what dimension of the table I would use). Is there another way to do this?

    < script type = "text/javascript" >
    total() function
    {
    var Field1 = document.getElementById("DUP").value;
    var Field2 = document.getElementById("COPIES").value;
    var field3 = document.getElementById("ORIG").value;
    Field4 var = document.form2.paperlist.value;
    sphere5 var = document.form2.paperlist.value;
    If (Field1! = "no")
    document.getElementById("mytotal").value = parseInt (field2) *.
    parseInt (field3) / 2 * parseFloat (field4);

    on the other
    document.getElementById("mytotal").value = parseInt (field2) *.
    parseInt (field3) * parseFloat (field5);

    }
    < /script >

    Select name = "paperlist" id = "paperlist" onchange = "total ()" > "
    < cfoutput query = "paperlist" >
    < option value = "#paperlist.single_side # #paperlist.two_side #" > #paperlist.descr #, #paperlist.single_side #, #paperlist.two_side # < / option >
    < / cfoutput >
    < / select >

    < input type = "checkbox" name = "DUP" id = "DUP" onchange = "total ()" accesskey = "3" tabindex = "3" > "
    < input type = "text" name = "COPIES" id = "COPIES" onchange = "total ()" accesskey = "1" tabindex = "1" default size "0" = "10" = > "
    < input type = "text" name = "ORIG" id = "ORIG" onchange = "total ()" size = "10" accesskey = "2" tabindex = "2" default = "0" / > "
    < input type = "text" name = "mytotal" id = "mytotal" readonly = "true" size = "10" / >
    < input type = "submit" name = "submit" value = "Submit" / >

    I guess you want to get the "selected" option from the selection list?

    You call the js function in the onchange event of the select list just pass it as a parameter

    Select name = "paperlist" id = "paperlist" onchange = "total (this.selectedIndex.value)" > "

    total function (slectedValue)

    or

    document. FORMNAME. SELECTLISTNAME.options [document. FORMNAME. Alue SELECTLISTNAME.selectedIndex] .v

    This will give you the value selected from the list of selection, simply replace "FORMNAME" with the name of your form and your 'SELECTLIST' with the name of your selection list

    Ken

    Edit:
    Should have to read it again, yes you can do it.

    It is not clear which character you have between 2 values in the value attribute of the selection list, but I would suggest a comma, no spaces

    Then

    field5Array = field5.split(',');

    This will then give you the picture that you want with
    field5Array [0] equal to single sided
    and
    field5Array [1] equal to double-sided

  • Help with the JavaScript for checkbox

    I am a newbie with Javascript and will have questions, get the selection of a checkbox on my form to change a calculation.

    I have a form that contains two drop-down lists, the result of these two boxes are multiplied together.  I can get it works fine.

    However, I also have a box that, when checked I want the calculation according to the drop-down lists duplicate.  I can't get that part to work!

    Can anyone provide the javascript code to activate this simple event?

    Any help is appreciated.

    Thank you.

    It should look like this:

    Get field values

    var v1 = combo1.value;

    var v2 = combo2.value;

    $ var = + v1 + v2;

    Get the value of the checkbox

    var v3 = getField("checkbox1").value;

    Calculate the value of this field based on the State of the checkbox

    V3 = Event.Value = "Off"? sum: 2 * sum;

    This last line is equivalent to the following five lines:

    If (v3 = 'Off') {}

    Event.Value = sum;

    } else {}

    Event.value = 2 * sum;

    }

  • When I try to open the file with Chinese or Japanese script, a dialog box appears in a black screen

    When I click on the PDF file, a dialog box appears with the text Chinese or Japanese on a black screen

    fornarina75,

    Try this:

    1 Quit Safari.

    2 start the player from the /Applications/ folder and accept the end user license

    3. load the PDF in Safari.

    Thank you.

  • Updated report with the javascript calculation

    Hi all

    I have an updated report updated when the user fills one column. I then need a simple multiplication based on the user filled in the column and another column to fill in the last column.

    I managed to do it using the JavaScript in the page header
    <script language="JavaScript" type="text/javascript">
    <!--
    function calcit(pThis)
    {
    var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);

    html_GetElement('f03_'+vRow).value = html_GetElement('f02_'+vRow).value * html_GetElement('f01_'+vRow).value;

    }
    //-->
    </script>
    F01 column is a value in a table based on SQL to create the report (AQLSCORE)
    F02 column is what the user fills out (AQLERRORS)
    F03 column is where the calculation is populated (AQLTOTAL)

    With the attribute of the element AQLERRORS = onchange = "additives (this); »

    The problem I have with the above is that it only works when f03 is a text field (that is, the user can change the value) I wish column not editable (the user should not be able to edit this field). If I do the column text display (saves the State) the calculation returns a NaN error.

    When I change the calculation of a * a + the return value 1undefined shows that the value of f01 is indefinite

    Demo app

    http://Apex.Oracle.com/pls/Apex/f?p=15328

    user name: demo
    password: demo

    There are 2 pages that where the calculation works, but with AQLSCORE as a text field, and another where he returned NaN but with AQLSCORE as display text (saved state)

    Any ideas how I can perform the calculation and protect the AQLSCORE of the user column

    Kind regards

    Alex

    Published by: user10942729 on July 30, 2010 08:12

    Take alook at the modifed JS in the header HTML

    The f01_000n elements are display (saves the State) so that they appear as follows in the HTML DOM.

    2
    

    To access the content, you will need to use innerHTML as the 'value' attribute is not in use here.

    BTW, for

    html_GetElement('f03_'+vRow).value 
    

    You can use the shortcut

    $x('f03_'+vRow).value 
    

    Kind regards.

  • The find-&gt; find Messages dialog box has no place to enter search terms. How do I do that?

    OSX Yosemite / Tbird 38.3.0

    No amount of fiddling with the controls does make a difference. In previous versions, there was an empty query in the top pane, along with a button to add more.

    Thank you. useful comments. There seems to be some visual oddities like that, but only on Mac computers.

  • something wrong with the pc cannot find answer

    PC crashes may be hard to do with the digital music download wrong speed of walkman or bad I pressed the button

    We will not give you an answer targeted with so little information. Start your troubleshooting here:

    The first Question of troubleshooting: If the problem is new, what has changed between the time things worked and the time they do not have?

    The second issue of Windows troubleshooting: what is the status of virus/malware of the machine? If you think it's clean, what programs (and versions) allows you to determine this?

    Make sure that the computer is clean:
    http://www.elephantboycomputers.com/page2.html#Removing_Malware

    If the computer is free of viruses/malware, try a system restore to when things worked.

    MS - MVP - Elephant Boy computers - don't panic!

Maybe you are looking for