Add the hyperlink by script

Hello

Is it possible to add hyperlinks in javascript, so that they can be assigned later in the document? Let me explain my thoughts:

hyperlink.jpg

This screenshot shows a list of the various documents (001 to 005) and the URL for the first document. I have a hyperlink to each of them automatically. Because the file is saved as 54K0504001.indd, I think it's possible.

What should I need:

1. a pop up with a question: "how many hyperlinks to do."

2. According to the reply, creation of new hyperlinks in the Panel with the full URL (if the answer is 2, I should get 2 links hyperlink, http://www.dekamer.be/FLWB/PDF/54/0504/54K0504001.pdf , and http://www.dekamer.be/FLWB/PDF/54/0504/54K0504002.pdf

OK, clear. It sounds simple enough:

main();

function main() {
    var num = prompt ('How many hyperlinks?', '1', 'Create hyperlinks');
    if (num === null) {
        exit();
    }

    function pad (n) {
        return ('00'+n).slice(-3);
    }

    var base = 'http://www.dekamer.be/FLWB/PDF/54/0504/54K0504';
    for (var i = 1; i <= num; i++) {
        var hl = base+pad(i)+'.pdf';
        app.documents[0].hyperlinkURLDestinations.add(hl, {name: hl});
    }
}

You could probably automate completely, but it is more work.

Peter

Tags: InDesign

Similar Questions

  • Add the hyperlink to an email

    I'm trying to add a hyperlink to a local document (Excel file) in the body of an email.  I use 'SMTP Email send message' and tried wiring of several different string formats the body trying to attach a hyperlink and have had no luck.

    Any ideas?  I have the report generation tool, but do not have the Internet Toolkit.

    Thank you very much

    Mark

    By inserting file:/// before the file name, a local link linkable was created.  When read by mail Outlook/program that appears as a link.

    i.e."file:///C:\Documents and Settings\user\excelsheet.xls" would connect to the Excel worksheet.  This method works for local files.

    Mark

  • How we can add the hyperlink in the screen.

    Hello

    I want to add a hyperlink in the window that opens another screen. How we achieve this.

    Take a look at this thread.

    http://supportforums.BlackBerry.com/T5/Java-development/make-an-email-label-clickable/m-p/19496#m65

    Concerning

    Bika

  • Add the hyperlink to the real banner

    Hy. I just finished my banner but I need to add a hyperlink to a specific address. How this can be done? I'm quite new with Flash so please be detailed with the news.

    Thank you!

    For the hyperlink to a web page, you can use navigateToURL() in conjunction with a button and event-handling code.  Create the button/movieclip/sprite, place it on the stage where you want the interaction to occur and then give it a name of instance via the properties panel.  Let's say you name "btn".

    Then place the following code in a new layer of the timeline in the same numbered box where is the button.

    btn.addEventListener (MouseEvent.CLICK, clickedLink);

    function clickedLink(evt:MouseEvent):void {}

    var url: String = "http://, etc.;  / assign the address hyperlink in quotes

    navigateToURL (new URLRequest (url), "_blank");

    }

    If you wish to have the new open web page in the same browser window, replace "_blank" by "_self".

  • 5.5 - How to add the hyperlink to URL on the page of the quiz?

    Hi, I have a PPT background imported by hyperlinks to URLS. As-is, the work of hyperlinks to fine in Captivate. My problem is that I want it to be a background in a slide of questionnaire. (The quiz slide is a corresponding slide. I wish that the answers on the slide to hyperlink to the URL with more information on the topics. If the user does not know the answer by the view, he or she can open the hyperlink, do a little reading and research, and then choose an answer on the questionnaire slide.) These are the solutions I've tried:

    • Copied and pasted slide as a background in a slide of questionnaire - hyperlinks do not work. (I assume that it uses the background image only).
    • Deletion of hyperlinks in PPT slide - imported into Captivate - attempted to create the quiz slide hyperlinks using text boxes or click on the boxes - cannot add those. (I guess that Captivate does not allow any other interactive buttons on his quiz slides.?)
    • Abandoned on the groundswell - tried default hyperlink Question and Answer buttons slide quiz - can't do. (I guess that Captivate does not have to perform several actions, objects of default quiz.?)

    I would appreciate any advice you might have. Is my only option to create an additional slide with hyperlinks and then provide a separate questionnaire slide? ("Click on the links below to learn more about these topics. Then move to the next slide to complete the corresponding fiscal year. ") I guess that will work, but it seems awkward.

    Thank you very much.

    In 6 Captivate, you can add a form button to a question slide, and it has "Open URL" in its list of possible actions. More information on the buttons of form in this blog post:

    http://lilybiri.posterous.com/want-a-button-on-question-slide-in-Captivate

    I recently presented a webinar for Adobe on these form buttons. In this blog, you will find the link to the recorded webinar:

    directories - actions.html http://blogs.adobe.com/Captivate/2012/09/Training-lilybiris-Favourite-Shapes-to-Trigger-ad

    You cannot add interactive objects to a question slide in Captivate 5.5.

    Lilybiri

  • How to add the hyperlink in the page of the ofa

    Hi all


    I have a requirement where I have a table in the form OPS with 5 columns, only a single column called pageid page; page id values must be hyperlink.
    so when the user clicks on the hyperlink, it must open a page with empty fields, so that the user can enter data and click Save button.
    Please someone tell me how to get this.or to give me links to simlilar it can help me :-)
    Thank you.

    Hello

    * / oracle/apps/fnd/frame/box in tools/labsolutions/webui/EmpDetailsPG * is the page where you want to navigate after clicking on the link, empNum and empName are the variable that will be passed to the next page and you can get the value of these variables in method PR only @EmployeeName and @EmployeeId are the way to assign the value of an attribute VO of the page where the link is created the value will be assigned to empNum, empName.

    Thank you
    Pratap

  • Add the hyperlink recompose document

    Hello

    I get documents of a company who uses hyphenation specific plugin which is their own.

    I a script that adds hyperlinks by using:
    -linkDestination = myDocument.hyperlinkURLDestinations.add
    -linkSource = myDocument.hyperlinkTextSources.add
    -then myDocument.hyperlinks.add (linkSource, linkDestination, {name: Nom_lien_hypertexte});
    It causes the reconstruction of the text with different hyphenation I have not (and should not) have the specific unhappy plugin.

    Is there a way to create hyperlinks without the current document recomposed (in fact no text or the style has changed, there is no need to recompose)?

    Kind regards

    Lionel

    PS: I use indesign CS5.5

    Yes, to my dismay, I saw this happen on complete documents in the case: adding a simple XML or a hyperlink tag - that should have been totally transparent for text - suddenly made the text re - dial.

    A possible solution for Lionel is to create rectangles on top of the text and assign hyperlinks to them instead. These rectangles could be created on a layer that is clean, so that they are eliminated easily if the text is changed.

    A small disadvantage is that you can measure, down, left and right of the text - but not by the top! However, you can kind of fake it: make the rectangle a leader high amount and move it down by about a 1/3 of its height (eye or result).

  • How to add the hyperlink on front panel

    Hello

    I want to add hyperlinks on my front. After clicking on who can access run another VI of disc or simply give me the functionality of a booleon control.

    I don't want to use the button for this.

    I want these hyperlinks for my standalone application main menu items.

    Have you tried a search? This has been asked before, and the proposed solutions were provided. See, for example

    http://forums.NI.com/T5/LabVIEW/do-you-know-how-to-create-front-panel-like-Web/m-p/1289778

    I think there may have been an idea posted in the Exchange of LabVIEW ideas as well. If this is not the case, do not hesitate to submit a suggestion so it can be voted on.

  • Programmatically add the hyperlink to TextFlow

    Hello

    Currently, I add hyperlinks to a TextFlow as follows:

    public function setHyperLink( linkInput:String ):void
    {
         if (editor.selectionActivePosition != editor.selectionAnchorPosition)
         {
              var content:String = TextConverter.export(editor.textFlow , TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE).toString();
              var selection:String = editor.text.substring(  editor.selectionAnchorPosition,editor.selectionActivePosition );
              var text:String = TextConverter.export( editor.textFlow, TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE ).toString();
              var arr:Array = text.split( selection );               
              var output:String = arr[0]+"</span>" + 
                                            "<a href='"+linkInput+"' target='_blank'>" +
                                 "<span>"+selection+"</span>"+
                             "</a>" +
                             "<span>"+arr[1];
                   
              editor.textFlow = TextConverter.importToFlow( output, TextConverter.TEXT_LAYOUT_FORMAT );               
         }
    }
    

    It works fine until the selection: the string is '2008', which leads to a divided since the markup String contans 2008 incorect:

    "< TextFlow whiteSpaceCollapse ="preserve"version ="2.0.0"xmlns =" http://ns.Adobe.com/TextLayout/2008 ">"

    Anyone see an another way to get the textflow before and after a certain position?

    Probably with "editor.textFlow.shallowCopy"? But I have FlowElements.

    But how to join these FlowElements and my hyperlink together as textflow?

    beforeLinkFlowElement + link + afterLinkFlowElement?

    ...

    How to add links in this demo:

    http://labs.Adobe.com/technologies/TextLayout/demos/

    ?

    [EDIT:]

    OK found:

    http://tourdeflex.Adobe.com/Flex4.0/tlf/srcview/index.html

    I'll study this now

    [EDIT:]

    OK I found that works, but how to set the default bind / the appearance of color? There is no default value after the application of this function?

    private void changeLink(urlText:String,_targetText:String,_extendToOverlappingLinks:Boolean):void

    {

    if (activeFlow & & activeFlow.interactionManager is IEditManager)

         {

    IEditManager (activeFlow.interactionManager).

    IEditManager (activeFlow.interactionManager) .applyLink (urlText, targetText, extendToOverlappingLinks);

    activeFlow.interactionManager.setFocus ();

         }

    }

    These Interfaces make it quite difficult to understand

    If you find that the appellant in the tlf is null object, pls create it yourself.

    tf.linkNormalFormat = new TextLayoutFormat();
    tf.linkNormalFormat.color = 0xFF0000;

    There are some attribute objects in TLF you need to deal with as the case may be, for example textflow.interactionManager.

  • How to add the hyperlink to the full report

    Hello

    I have a report and the last line display total report (using default apex - check check sum).



    My last line like below
    ------------------------------------------------------
    Total report | 10. 20. 30. 0 | 100.
    ------------------------------------------------------

    My requirement to add hyper link to the numbers 10, 20, 30, 0, 100 total for the report.

    Any help will be much appreciated.

    Thanks in advance

    Shijesh,

    There is really no way to do this. I only really see a way - jQuery. You will need to start by entering in the report and by replacing the "display this text when you print the report amounts" with something like:

    <span id="repTotals">Total:</span>
    

    This will give something to recover for jQuery. From there, you will have to go up to the line, then in specific columns of the line by replacing the content that the page loads with your hyperlinks.

    Kind regards
    Dan

    http://danielmcghan.us
    http://sourceforge.NET/projects/tapigen

  • Add the hyperlink in a page to direct to a .pdf report in oracle jdeveloper, ADF

    Hello

    I want to put a hyperlink, which will lead the user to the report. but I have the problem with, "where should I put the pdf file" any help please?

    Here is my code:

    < a target = "_blank" href =' / faces/DocumentationKNM.pdf '> Guide Book < /a >

    What should be the href?

    Well, it depends of course when the pdf report can be found on your server, and if it is accessible from the web application. For this, it must be somewhere in the web root of your application. To access the report somewhere else on the server, you can implement a servlet and circulate the report from there.

    Summary: we need describe your use cases in more detail.

    Timo

  • Add the hyperlink to open a falsh movie

    Hello

    In Captivate 4: I am looking for a way to add a link to one of the slides that will open a URL.

    Is it possible to do?

    Thank you

    Merav.

    Hi Lilybiri

    The scenario seems to me that the object button is pause the slide before click, no areas? So if the blade is paused and the click boxes don't release the break when they click, by disabling the option "Continue", would not keep the playhead paused?

    Note that I didn't set up a corresponding scenario to fully test, but it seems to me that this is how it would work.

    See you soon... Rick

    Useful and practical links

    Captivate wish form/Bug report form

    Certified Adobe Captivate training

    SorcerStone blog

    Captivate eBooks

  • Effect of substitution does not work once I have add the link

    I have a photoshop button that has 2 States: Normal and rollover. Rolling works before you add a hyperlink to it, but when I add the hyperlink and listen to extracts from the website, the bearing stops running. Can you explain where I'm wrong? The transition works fine until I have add the link.

    Thanks for your help!

    The only way that it would not work is if you are linking to the same page as you. Other than that, the only other explanation is that your Muse program has a bug.

  • How to add the mask into effect reference is Options for Composition with after effects CC 2014?

    The main reason why I'm updating my After Effects with cc 2014 is "composition for each effect options, including the ability to limit the area affected by each of the effects with masks". This useful feature really simplify my work. But now I realize that I want to use the script function.

    I get Composition Options the effect name and matchName.It looks like this:

    NameNameNameNamepropertyValueTypeRemove
    Composition optionsundefinedADBE effect built in Params
    MasksundefinedEffect ADBE Mask Parade
    Reference mask 1undefinedADBE effect mask
    Reference mask 1MASK_INDEXFlow path ADBE effect Ref
    Opacity of the effectOneDADBE mask opacity

    I try to use .canAddProperty ("ADBE effect mask") and .canAddProperty ("ADBE Path flow Ref effect"). However, it returns false.

    I found that add or delete this property in the user interface are the buttons '+' and '-', so maybe I can use app.executeCommand (app.findMenuCommandId (theCommand)); However, I can't find that button name because it does not have a helpTips to remind me of the name.

    So how do you add the mask with script reference? Or ESTK has no permissions to access this useful property so far? I have not found anything on the Internet.

    Moreover, I have an another two quick questions:

    1. If there is more than two masks in a layer, remove for each mask is the same ("ADBE Mask Parade") ("ADBE Mask Atom"). How can I use the Remove to get the second mask such as the name property? First I treat like a table, but ("ADBE Mask Parade") ("ADBE Mask Atom') [index] actually did not work, so that ("ADBE Mask Parade") (" ADBE Mask Atom'") (index) is referring to the child property altogether in the first mask. I have no idea about it.

    2. when I use the method property() with script, property ('effect'), and property("effect") are all the two ok. The only difference in the method is the single quotes ' and the Quotation brands "." I just want to know if the "and" have any difference in the method property (), except that "this color is blue" and "this color is purple" in ESTK.

    The advice and the answer would be appreciated.

    Yes you can add masks to the effects by script.

    If "fx" is a fx on a layer:

    var fx.compositingOption = co;                                  or fx.property ("ADBE effect Built In Params')

    var fxMasks = co.mask;                                            or co.property ("ADBE mask Parade"): INDEXED_GROUP j

    fxMasks.canAddproperty ("ADBE effect mask");    true

    var fxMask = fxMasks.addproperty ("" ADBE effect mask");

    fxMask.maskReference.setValue (1);                        or fxMask.property ("ADBE effect way Brook Ref") .setValue (1);

    If you can do short

    fx.compositingOption.mask.addProperty("ADBE Effect Mask").maskReference.setValue(1);
    

    Xavier.

  • A loop through hyperlinks and add * at the end of the hyperlink source text?

    Hello

    I'm sure it's very simple, but my javascript is a little rusty and a little short of time, so I was wondering if someone could point me in the right direction?

    I need a script that loops through all the hyperlinks in a document (no matter what styles are or are not applied). Please check the source text to see if it starts with "www" or "http".

    If the source text starts with "www" or "http" then do nothing. OTHERWISE add an * at the end of the text. In other words if there is text in the document as "Click on this link" (and there had a hyperlink applied) it would be changed to "click on this link." If there is text in the document as "www.google.com" (and there had a hyperlink applied), it would remain unchanged. The hyperlinks themselves remain unchanged.

    So I'm not sure what my If/else statement must be?

    Links = app.activeDocument.hyperlinks;

    for (i = 0; i < links.length; i ++)

    {if

    ???

    }

    Thank you very much in advance for your help!

    Angèle

    How stupid. You are absolutely right. The names of hyperlink above, test script must test the hyperlink source texts. In the small sample, I have tested the script on, names of hyperlink and source texts were the same, that's why I had not spotted the questionable logic of the script. This scripts properly tests:

    hlinks = app.documents[0].hyperlinks.everyItem().getElements();
    re = /^(?:http|www)/;
    for (i = hlinks.length-1; i >= 0; i--) {
      if (hlinks[i].source.hasOwnProperty ('sourceText') && !re.test (hlinks[i].source.sourceText.contents)) {
        hlinks[i].source.sourceText.contents += '*';
      }
    }
    

    This would also explain the unexpected behavior of your / ^ j / test. (/ ^ j / tests whether a string starts with 'j' - no need to the * or the parentheses.)

    Peter

Maybe you are looking for

  • Refund purchase iTunes

    I recently bought a song on iTunes, but realized that I bought the wrong song. I reported it to apple and they sent me an email saying that I was refunded, but it shows that I have still no store credit, help!

  • Digital text

    I noticed that whenever I send a digital text to a friend, I also get the same text myself on my phone. Is there anyway to do that to happen stop?

  • 920XL failure

    I had the same experience with a cartridge 920XL what spread all over my workstation from the opening.  It was made in China and has an expiry date of guarantee June 2014.  This is the product no. CD975AN, 140 Option.  I could clean the office, but t

  • How can I attach a video to an email?

    I have a windows 7 and how do I attach a video to an email?

  • Editing images/editing text on ipad pro

    Just got an email to combine the project files, and drag-and - d├⌐poser to arrange pdf pages.  I just listened to the video and it says you can save to the cloud, then make the changes from your ipad anywhere.  I tried to do and not able to.  I have