Make hyperlink text actual hyperlinks

We have a couple of CSV files we use for datamerging with InDesign. Some of the text in the CSV has hyperlinks in the paragraph.
Since InDesign does not automatically make hyperlinks in the CSV text actual hyperlinks and there is no special syntax to indicate it is a hyperlink (such as using @ for image paths).....we have decided to wrap any hyperlink text with the <link></link> tag.
InDesign, we want to find all of these <link> tags and replace it with an actual hyperlink. The link maybe an http link, mailto link, or a tel link.
How would I do this with InDesign scripting (prefably javascript or c#)?
I have the following so far in C# (similiar to javascript):
app.FindTextPreferences.FindWhat = "<link>";
How do I replace it with a hyperlink?

Hi,
as you want to use the found link itsself as textsource ... have you thought of calling the command 'convert Urls to hyperlinks in the GUI'¿
The link-tags wouldn't be needed then ...
A script could be like this:
app.findGrepPreferences = app.changeGrepPreferences = null;
var doc = app.activeDocument;
app.findGrepPreferences.findWhat = '(?<=<link>)[^<link>]+(?=</link>)';
var objs = doc.findGrep();
l = objs.length;
while(l--)
     var currTarget  = objs[l];
    var lnkDest = doc.hyperlinkURLDestinations.add(currTarget.texts[0].contents);
    var lnkSrc = doc.hyperlinkTextSources.add(currTarget);
    var lnk = doc.hyperlinks.add(lnkSrc, lnkDest);
    var leftIndex = currTarget.index;
    var rigthIndex = currTarget.index + objs[l].length;
    var pStory = currTarget.parentStory;
    pStory.characters.itemByRange(rigthIndex, rigthIndex+6).remove();
      pStory.characters.itemByRange(leftIndex-6, leftIndex-1).remove();
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = '<link>|</link>';
app.changeGrepPreferences.changeTo = '';
doc.changeGrep();
The commented stuff would delete the link-Tags during the repeatloop instead of the actually used second search ...
Didn't test what'll be faster ...

Similar Messages

  • How can i make hyperlink to local file for dowloading

    How can I make hyperlink to a local file for downloading it, it seams that only www links work in web Ui.
    Thanks

    If we assume that you have a LabVIEW application running on your cRIO that is exposing some data through web services, there are a couple of possibilities.
    You can create a web service call that returns the log data. In order for the browser to treat this as a file, you must set the correct content type in the http header. To do this you can't use the default form of data output. Instead you must create an "httpRequestID" input to your web service VI. With this you can call "Write Response.vi" to give the log data and "Set HTTP Header.vi" to specify the type (text/text probably works for a log). You can look at "examples\comm\webservices\address book\FindContacts.vi" to see an example of calling these 2 VIs. Once you create that web service entry point, you can set that as the URL of the hyperlink control and it should work.
    Another option is to have the cRIO application write to a log file that is under the root of the web server running on the machine. (This is the same place the xap for your Web UI Builder application is put.) This file could then be served up through the web server just like any other file.
    With either of these solutions there may be concerns about the browser caching results rather than requesting new content each time. There are additional values that can be set in the http headers with the first solution that can help with this, but I think there is still some variation between browsers.

  • How to make hyperlinks in JTextField/JtextArea  ??

    My JTextField/JtextArea has got this Text.
    String text = "Get information from http://www.hotmail.com, if you have problems go to http://www.google.com " ;
    How to make hyperlinks for http://www.hotmail.com and http://www.google.com texts only???
    And how to call those sites???

    Add a mouse listener, when the user double clicks - see if they've clicked on text that is a valid link.
    The limitation of using textfield or textarea is that you get no styling. I dont know why you're refusing those suggestions, but you're just creating more work for yourself.

  • Make Hyperlinks Active works on URL, not on PDF files

    When I'm working on my site and click "make hyperlinks active" to test them, the link associated with a web page at another site on the Internet works, but the hyperlinks associated with pdf files I've selected on my computer don't work. I click and nothing happens.
    When I check the files on the computer and just click on the they open fine. They won't work from iWeb, however, when I check make hyperlinks active.
    When I uploaded the site, and tried to download the pdf files by clicking on the links on my site, some worked and some didn't. Some opened rather quickly, some took forever.
    ANY AND ALL HELP IS APPRECIATED.
    Rex

    The link to a file doesn't work in the iWeb application
    Publish your site to a folder on the desktop, launch it in your browser by double clicking the index.html file and click on your PDF link to see if it directs you to its location on your hard drive.
    If it doesn't, you have not set it up correctly in iWeb.
    If you are uploading to a server other than .Mac, open an appropriate page folder on your server using your FTP application to see if the PDF or Zip file is actually there.

  • Can't make hyperlinks in CS 5

    I can't make hyperlinks in ID CS5. I highlight some text, select new hyperlink in the hyperlink panel, type in a url, cllick ok. The linked text shows up in the panel, but in the document it's still just text. It's not a link. What am I doing wrong?

    If you have a full URL showing in your text, you can choose New Hyperlink from URL from the Hyperlink panel menu.
    If you want an object or text to create a hyperlink to the URL, the method is different: You need to make a hyperlink destination first. On the Hyperlink panel, choose New Hyperlink Destination from the panel menu. Choose a URL destination. Then move to the object you want as your trigger and choose New Hyperlink.  Select the URL destination as the target.
    If that's not working, try deleting your InDesign preferences: http://forums.adobe.com/thread/526990

  • Make hyperlink different color than others on page

    I want to make a text hyperlink (in Comic Sans) white in all of its states while leaving the rest of the text links on the page the default blue. In Site Properties, I created a text hyperlink called FIND OUT MORE! making all states white, and bold text, but when clicking OK, nothing applies or changes for the text selected - still default blue. See image - want to change the hyperlinked text in the black box to white. Is this possible?
    Thank you!

    I seemed to have solved this issue by ignoring the text within the box and making a hyperlink for the box which includes the text in the hyperlink. I didn't bother changing or deleting the hyperlink setting I created in Site Properties, though I don't think it has any bearing.

  • How can I make hyperlinks work from a Flash/SWF presentation?

    How do you make hyperlinks/buttons work in Flash/SWF Captivate 5.5 presentations? This did not seem to be an issue with Version 4. I cannot publish to video (i.e. mp4) or as an executable file for posting on our internal system. If it cannot be done in Flash/SWF, how else can I get buttons/hyperlinks to work? Thank you.

    Welcome to our community
    Please take a look at the links below. Not only do they answer your question, they are there to help you get the best forum experience.
    Forum Participation Suggestions
    Frequently Encountered issues
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • This is probably a dumb question, but I can't find an answer. How do I make the text on my calendar larger so I can actually read it when I print it out?

    This is probably a dumb question, but I can't find an answer. How do I make the text on my calendar larger so I can actually read it when I print it out? I am using a MacBook.

    Press "Command P" and when the Print dialogue box comes up, towards the bottom there is an option allowing you to choose the text size, i.e: small, med, large.
    Hope this helps,
    NEIL

  • Can you make drop down menus and can you make hyperlinks to parts of a page

    I was just wondering if it is posable to make drop down menus on iweb and if it is possible to make hyperlinks on the same page to another part of the page because the page is very long.

    if it is posable to make drop down menus on iweb
    No. You have to make them yourself. Search this forum :
    [dropdown menu|http://discussions.apple.com/search.jspa?objID=c188&search=Go&q=dropdown+menu]
    Here's how (to add all kinds of menus) :
    http://cafenoir.atspace.com/Maaskant/How_To.html
    http://cafenoir.atspace.com/roodhout/HowToDo.html
    Sample here :
    http://cafenoir.atspace.com/roodhout/
    if it is possible to make hyperlinks on the same page to another part of the page because the page is very long.
    Not in iWeb directly. Search this forum :
    [anchors|http://discussions.apple.com/search.jspa?threadID=&q=anchor&objID=c188&dateRange =lastyear&userID=&numResults=15&rankBy=10001]
    Here's how I do it :
    http://www.wyodor.net/Tutorials/Anchors

  • Can Muse make hyperlinks open in a separate browser window?

    Is there a way to make hyperlinks within Muse open in a separate browser window?

    Yes there is, with the hyperlink selected click the blue "hyperlinks" aat the top then select "open the link in a new window or tab"

  • How to make a text "drawer" in iWeb

    Does anyone know how to make a text "drawer" in iWeb? What I mean is when you click on a hyperlink to read more text, but instead of opening up a new page, it makes the text appear below the link on the same page.

    Anything fancy with iWeb has to be done in the HTML Snippet or after publishing the page.
    Find the code for the drawer, apply it and show us the result.
    Perhaps not the drawer you had in mind but this is something near:
    http://www.wyodor.net/Ajax/
    Here's another one with drawer in the title:
    http://jqueryfordesigners.com/slide-out-and-drawer-effect/
    http://jqueryfordesigners.com/demo/plugin-slide-demo.html
    Found with : [text drawer|http://www.google.com/search?client=safari&rls=en&q=text+drawer&ie=UTF-8 &oe=UTF-8]

  • Anyone know how to make vertical text in a table in keynote?

    anyone know how to make vertical text in a table in keynote?

    Just to add a bit more about this question. I have seen in other related questions that this feature (vertical text) is not available in (apparently) the whole iWork09. someone even said that it should be asked to the developers, so they include this feature in iWork10. I find this issue a bit sad. This feature has been present in msOffice since a while, and at least for me, this is quite important for my work. It is also apparently not possible to have different page orientation in the same document, meaning portrait and landscape, so one can have wide tables in a whole page, for example. If this is true, it is again sad, and I just cannot understand why such a basic feature is not available in an already 09 version. I am using only the trial version of iWork, but already in the first day I have discovered that I actually cannot do what I was used to. Again sadly I (and many others I guess) will have to stick to Office until the mac software is fully developed.

  • Almost finished!!  How to make JButton Text word wrap??

    Is this possible? If so, how or, where do I go to get the answer. After reviewing the JButton class (which I really don't always understand the leap between the API documentation and the actual code that is derived from it) and its constructors, methods and inherited everything, I cannot seem to find a way to make my text wrap in a JButton.
    It just disappears to the right, but nicely centered.
    Much appreciation.

    This is why you don't post the same question multiple times....
    I answered your question in your other thread, and was all ready to ignore this thread when I saw the dukes.
    Answer is here:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=372505&tstart=0&trange=15
    Cheers,
    Radish21

  • I cannot figure out how to make the text larger on an incoming email.  The finger method doesn't work and I cannot find any toolbar with which to do it.  I could find nothing in settings also.  Plese help and thank you.

    I cannot figure out how to make the text larger in a received email.  The finger method doesn't work and I can find no tool bar as I can for composing emails.  I can find nothing in settings.  Please help and thank you in advance.

    Hi there,
    Download a piece of software called TinkerTool - that might just solve your problem. I have used it myself to change the system fonts on my iMac. It is software and not an app.
    Good wishes,
    John.

  • How can I make a text box in Aperture transparent??

    Hello,
    After a great trip to Thailand I want to make a book of all my pictures using Aperture 3. At some places in the book I use a title to indicate what will be shown on the image. This title is made by the text box and it is put on the image itself. Now what I would like is to make is a transparent bar of the text box, so that I still can see the details of the image through this bar and also read the text about the image easily.
    I have no problems making this text box and putting it in the right place, the thing that I don't understand, after two nights of trying, is how to make this text box transparent.
    Any help is appreciated!
    Thanks in advance!

    Perhaps I need to reformulate what I exactly want to do...!
    I would like to use transparent text boxes but not as transparent as the image itself. I want to show the text box as a real bar but slightly different than the original image colour. So something between a normal image and a white bar so that it will be a bit transparent but also shown as a real bar..
    I think the text boxes of each theme are identical, so yes you are right about the transparent text boxes of art collection but they are the same as photo essay.
    Do you understand what I mean?

Maybe you are looking for

  • ERROR while syncing the Text Index

    Hi All, We are facing an issue while syncing the text index on the table, and the error is below, System error: Plsql job execution is failed with error code -20000 and error message ORA-20000: Oracle Text error: DRG-10017: you must be CTXSYS to do t

  • Importing stills into CS6 from Photoshop CS4

    I appear to be unable to import my still images from Adobe Photoshop CS4 (file types psd) into Premiere Pro CS6 and get the following error message "The importer reported a generic error".  Am I missing a very simple trick (other than having to upgra

  • No Matching Record Found G/L Account

    hi everyone! I am just a new user of SAP B1, I would just like to ask about the error I encountered while doing a credit memo, the error says "No Matching Records Found G/L Account. Please help me resolve this error if you have any ideas. Thank you.

  • Error download lightroom

    hi, i need your help... i tried download the lightroom, but i cant because said "Can not connect to servers Adobe. Check the firewall settings and try again in a few minutes" I check de firewall and dont start. Can you help me? I'm from Argentinian..

  • Configuring IMAP - POP - SMTP over SSL

    Hi, I have configured SSL for webserver. I have copied same cert database (cert8.db and key3.db) in the config directory of messaging server. Changed the ownership of database to messaging server user. Password file is updated. I am able to see the c