Add the same text to each hyperlink in Indesign

Hello.

I have a simple JavaScript search and replace text in hyperlinks. I was wondering if this can be rewritten to simply add additional text to each hyperlink in the Indesign document.

for example "1234" will add 1234 at the end of each hyperlink. Google.com will become google.com1234

Thank you very much!

main();

main() {} function

var d = app.dialogs.add ({name: "Replace the URL of the hyperlink values"});

col1 var = d.dialogColumns.add ();

col2 var = d.dialogColumns.add ();

col1.staticTexts.Add ({staticLabel: "find (GREP)": ""});

col1.staticTexts.Add({staticLabel:"Replace:"});)

find var = col2.textEditboxes.add({minWidth:100});)

change of var = col2.textEditboxes.add({minWidth:100});)

var result = d.show ();

{if(!result)}

d.Destroy ();

return;

}

var grepForFind = RegExp (find.editContents, "g");

var grepForReplace = change.editContents;

d.Destroy ();

var = app.documents dests [0].hyperlinkURLDestinations.everyItem () .getElements ();

for (var i = 0; i < dests.length; i ++) {}

DestS [i] .destinationURL = dests [i].destinationURL.replace (grepForFind, grepForReplace);

}

}

Hello

Try this...

hlinks = app.documents[0].hyperlinks.everyItem().getElements();
for (i = hlinks.length-1; i >= 0; i--) {
    if (hlinks[i].destination instanceof HyperlinkURLDestination){
        hlinks[i].destination.destinationURL+= '1234';
    }
}

Concerning

Tags: InDesign

Similar Questions

  • How to apply/generalize the same text of failure in all Failure_Caption in the project in order to avoid manually change in each legend of failure?

    How to apply/generalize the same text of failure in all Failure_Caption in the project in order to avoid manually change in each legend of failure?

    For example the 'wrong' text in all the legend of failure

    You can set the default text that appears in all the legends of failure for the quiz via the parameters for the Quiz questions.  However, after you have made changes here that will affect quiz slides that you add AFTER that, change.  There is no way to change the text in all the legends of defect EXISTING at the same time.  You will have to select each one and replace the current text manually.  If you firmly believe that you will need to do this more than once, you might consider using a user Variable that displays as the value in the legends of the failure.  Then you can edit them while changing just the value of the user variable.

  • Add the same page to several PDF at a time?

    I have 50 booklets created, and now I have to add a page for booklets. Instead of open each pdf document individually, is there a way to add the same page of pdf at the end of each book at the same time? I'm going to do this as many times that the content of the booklets are constant, and the last page is sometimes added as a page "to measure". So, if this is possible, it would be same a me lot of time. Thank you very much.

    Possible with the Action Wizard and the Javascript.

  • I created a custom and registered with a specific name date format. However, when I open a new worksheet, my saved format does not display in the menu drop-down? Am hoping that I don't need to create the same format for each new sheet?

    I created a custom and registered with a specific name date format. However, when I open a new worksheet, my saved format does not appear in the menu drop-down? Am hoping that I don't need to create the same format for each new sheet?

    You must save the spreadsheet containing the new date as a model format and use this custom template for each new spreadsheet where you want that this date format personalized at your disposal.

  • I've updated for picture with the captain and when I plug in my iPhone it loads the same pictures twice each time how it stop loading the same things every day?

    I've updated for picture with the captain and when I plug in my iPhone it loads the same pictures twice each time how it stop loading the same things every day?  I tried to make the old default iphoto but picture still open when I plug in my iPhone?

    I tried to make the old default iphoto but picture still open when I plug in my iPhone?

    When the iPhone is connected and Photos opens, select iPhone in sideba of the windowr of Photos. Then, uncheck the option 'Open for this iPhone Photos' below the toolbar.  Do this for all your iPhones. The hook should be unmarked for each device individually.

  • Is it possible to draw the same color for each curve automatically

    Hello

    Is it possible to draw the same color for each curve automatically. I use graphic XY basis with data set.

    Lol you'll either need to set the properties through the dialog box.  Or use the nodes property of the graph to adjust the Active plot and then set the color of the plot.  This can be done in a loop For.

  • How to perform several steps and the display of charts/indicators without repeating the same code for each entry (of the dozens of entries)?

    I have to repeat the same steps and display in the Panel before (graphic fft and other indicators).

    Do I need to repeat the same code for each entry/channel? I already have too many channels and whenever I change a measure (and code) for an input/channel, I have to repeat the changes to all the other entries.

    Thank you


  • How can I add the same properties to the __names of a series of files

    I would like to add a few properties on the front of several files. instaead clicking Rename and add them one by one, how can I add the same properties in the names of a series of files

    Hello Ronke2009,

    Welcome to the Microsoft Answers Community!

    Using the function rename in Windows results in action that you said earlier, with all records even renamed with a number appended to the end. You can get the service you are looking for with a third party tool. A good search Bing.com for these would be something like Bulk Rename Utility or editor to rename block.

    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    Hope that helps, I look forward to hearing from you.

    Steven
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • Set a style different cases for the same placeholder (data fusion) used two times in the same text

    Hello.

    I have a document with some parties updated with the fusion of data (via placeholders). Is it possible to set a style of different cases for the same placeholder in the same text. See the example:

    Mike runs its < < vehicule_placeholder > > in the city. But its < < VEHICULE_PLACEHOLDER > > is meant to be shared.

    If the value of this placeholder in the file merger is 'bike', the sentence should be:

    Mike runs his bike in the city. But his BIKE is meant to be shared.

    Is this possible? How?

    Thank you.

    You can do it. A character style for this configuration placeholder text, set in all caps.

  • When you add the same audio clip of chronology not added?

    When I add a clip to the timeline of the first audio is also added as usual. When I add the same clip again, that it does not come with the linked audio file. When I hover over the blue icons in the project window, it is said "audio video used 2 times 'and' related used 1 time" I want audio to be also with the clip on the second clip. Why does this happen?

    FAQ: Why no audio or video will not at the track where I let down?

  • lov 2 in the same text element

    I create 2 LOV, I want to show in the same text element, the problem is: 1-) I want the code I have to write in the key_lstval. 2-) during the creation the 2 LOV, what I must do when I get the process of LOOKING up the VALUE return it... should I assign the text element LOV or leave it empty, because they are 2 lov allocation in the same piece of text. Thank you for your help

    == Use this one... and then check and confirm ==

    Start
    If: PYPSTSM_DATE > sysdate can
    SET_ITEM_PROPERTY ('PYPSTSD_STATUS_IND', LOV_NAME, 'LOV353');
    LIST_VALUES;
    on the other
    SET_ITEM_PROPERTY ('PYPSTSD_STATUS_IND', LOV_NAME, 'LOV368');
    LIST_VALUES;
    end if;
    end;

  • Dynamically add the instanceManager text value to instanceManager another

    Hello

    I have a dynamic form that has two subforms with instanceManagers. One is called options, and another description. Subform 'options' has a button that adds an instance both "_options" and «_description» InstanceManagers

    I click the button twice so I have three instances of each. Each instance of "_options" has a field OPTION, and each instance of '_description' has a DESCRIPTION field. I want to write code that will automatically set the text value of the OPTION to the value of the DESCRIPTION text.

    example:

    -options

    -OPTION (input field)

    -descriptions

    -DESCRIPTION

    Click

    Click

    -options

    -OPTION (1)(input field)

    -OPTION (2)(input field)

    -OPTION (3)(input field)

    -description

    -Description (1)(input field)

    -DESCRIPTION (2) (field)

    -DESCRIPTION (3) (field)

    fill option fields

    -options

    -OPTION (1)(rawValue: the soup is good)

    -OPTION (2)(rawValue: soup really sux)

    -OPTION (3)(rawValue: soup is ok)

    and here's my problem - how do I get these values for the other instanceManager? I have a code that does not work, but I don't want to offer something. Please, help me, I am struggling with this instance of reference bs for awhile

    You must use xfa.resolveNode to analyze the number of index levels.

    I just did a quick test with a few tables on the output of a field event in Table1, I put a corresponding field in Table2 to the same value. Works the same with subforms.

    xfa.resolveNode ("Table2.Row1 [" + this.parent.index + "]"). TextField1.rawValue = this.rawValue;

    Depending on how many levels deep into the repeating subform your domain is that you will need to play with the 'this.parent.index' to get the path to the repeating subform (this.parent.parent.index, etc.).

    Hope that's what you're looking for!

  • Make the same text of length and distribute evenly

    Hi all

    I'm creating a series of posters and I need to have lines of text with simple words or phrases of the same length. Obviously would the font size need to change upwards or downwards according to the number of letters per word/sentence that needs to be pressed in the specified length.

    The distance between the lines must be the same (IE 2mm).

    For the moment, I do these manually, that is to say, I am typing the text and manually enter the width and then align all the words and phrases to create a rectangular block of text. Also, I manually adjust the distance between each line, as using the distribution does not have the desired effect...

    Y at - it anyway to sort coins to automate the process above that I need to do a few posters with different texts.

    Thanks in advance for your help.

    Here you can select your text frames before the race. It should work in CS4 and ealier, I'll have access to CS5 tomorrow, will be testing there, hope it works too.

    #target Illustrator
    
    //  script.name = textBlock_CS4.jsx; // not tested on CS5 yet.
    //  script.description = converts selected point textFrames into a Block of Text;
    //  script.required = one document with at least two selected text frames;
    //  script.parent = carlos canto // 12/4/11;
    //  script.elegant = false;
    
    if (app.documents.length > 0)
        {
                        var sel = idoc.selection;
                        if (sel.length>1)
                                  {
                                            var width = prompt ("Enter desired Text Block width", 300, "Text Block"); //
                                            if (width!=null) // quit if pressed Cancel
                                                      {
                                                                var idoc = app.activeDocument;
                                                                //var ilayer = idoc.activeLayer;
    
                                                                var dupLayer = idoc.layers.add(); // add a layer to place the new block of text
                                                                dupLayer.name = "Text Block";
                                                                var blockGrp = dupLayer.groupItems.add(); // add a group to final output
                                                                blockGrp.name = "Text Block";
    
                                                                var left = idoc.width/3; // place block at the bottom 3rd of the page
                                                                var top = idoc.height/3
                                                                var spacingMM = prompt ("Enter spacing in Millimeters", 2, "Text Block"); // text lines spacing in mm
                                                                var spacingPts = new UnitValue(spacingMM,"mm").as ("pt") // convert to points
    
                                                                for (i=0; i 1
                        else
                                  {
                                            alert ("Select at least 2 textFrames before running");
                                  }
         } // end at least one document
     else
        {
            alert ("There are no open documents");
        }
    

    Post edited by: CarlosCanto

  • How to add the action button for each column in the interactive report

    Hi all

    I'm new in APEX, so pls forgive my question, if it's simple, but I am struggling with this problem for days now. I have interactive report and you want to add button in each row. What I want to do with this button is the following:

    1. to execute some stored procedure in need of that particular line item values

    2. returns a (id)

    3. go in another page in the application by passing the value out of the procedure (id).

    and I'm not find the way to do it. I tried now means:

    1. If I add the link of the column, so I can refer to the value of the current row, I don't know how to call the stored procedure and perform actions of rest I need

    2. If I add the button to the region, I do not know how to reference the values in column of a particular line of the interactive report...

    and I'm stuck...

    I just forms and global report and probably still think the "wrong" way .

    Any help would be appreciated!

    Thank you!!!


    user3253917 wrote:

    Please update your forum profile with a real handle instead of 'user3253917 '.

    I request of the company: there is a customer who always orders the same standard product orders (always order the same products, fair amount is different). I want to make it simple for the user: instead of retyping the command (master and few records details every time yet) I want to copy selected command (copy of the master record and record details) so that the user will only change date order (in master record) and amount fields in record details).

    So, in order to give him:

    1. the user must be able to choose the order in which I would copy (at page 4), select it,

    2. I need to make PL/SQL procedure to insert the new master record (order) and a few record details (order_items) (copy of the order/order_items chosen in step 1)

    3. navigate the user to page 29, where the master account at stage 2 insterted appears, so that the user can change the date and quantities.

    Any solution will be highly appreciated! Thank you very much!!!

    In simple terms:

    1. Add a link to column "Command copies" in the report on page 4, which sets the COPY request and passes the order ID on page 29.
    2. On page 29, create a process before header, sequenced to be the first process executed and conditional on REQUEST be EXEMPLARY, which creates a new order as a copy of the order with the ID from page 4 and returns the ID of the new order in the PK command ID of 29 page element.
  • Placing the same text in different files? CS6 ID

    Is there a way to save the text in a single document central and then place/link it in others so that when changes are made to the central document, the text is updated in all others? For example, the text can behave in the same way as related images?

    I design menus of the restaurants and the same menu text must be replicated in several different documents - posters, internal menus, screenshots. Currently I spend so much time do some settings for each separate file, and there is always the possibility that errors can be committed.

    Thanks in advance for the advice.

    JO

    Don't know. Never tried. I think that if the style names are the same, just different settings, it should work. But... I have never tried the InCopy export thing. I intend to because he just read about it this morning, but haven't yet.

    When I do, it will probably take with a few quick, fake docs using text Lorem Ipsum, name a few styles in two different ID publications and make obvious changes to the same style names.

    Take care, Mike

Maybe you are looking for