Change filename into link

I want to change the filename of a link into Indesign. For example: the existing filename is table_EX.jpg and now I want it to change into table_CZ.jpg
I wrote a script, but it seems that it only change ONE link. Who can help me?
#target indesign
// Relink file fileName.js
if (app.documents.length == 0) {
     err("No open document. Please open a document and try again.", true);
var myDoc = app.activeDocument;
var myLinks = myDoc.links;
var myCounter = 0;
if (myLinks.length == 0) {
     err("This document doesn't contain any links.", true);
for (i = myLinks.length-1; i >= 0 ; i--) {
     var myLink = myLinks[i];
     var myOldfileName = myLink.name;
     var myNewfileName = myOldfileName.replace("_EX", "_CZ");
     var myNewFile = new File(myNewfileName);
     if (myNewFile.exists) {
          myLink.relink(myNewFile);
          myCounter++;
document.save()
document.close()

Change
var myLinks = myDoc.links;
to
var myLinks = myDoc.links.everyItem().getElements();
This should work, because myLinks will not change during the updates.
Hope that helps.
Marijan (tomaxxi)
http://tomaxxi.com

Similar Messages

  • Filename into meta data

    I'd like to be able to add the filename into the meta data (File info) automatically on all the documents we work on. The reason being our client changes the file name and when they return the pdf to us for amends I have little or no way of locating the file amongst 25,000 documents.

    If you unzip this link:
    http://www.zenodesign.com/forum/MetaTitle.zip
    and copy the script to your scripts folder (Applications ▸ Adobe InDesign CC 2014 ▸ Scripts ▸ Scripts Panel), then open a file and run the script you'll see that the file name gets copied to the meta data Document Title and the file gets saved.
    So you could open Keyboard Shortcuts>Scripts find the script and give it the Command-S key command.

  • I'm having trouble with popups on my mac book pro constantly along with words on every page that have turned into links. how do i fix this???

    i have pop ups constantly from mackeeper and many other websites. i also have noticed that some words on all websites have turned into links... how do i fix the problem??

    You installed the "DownLite" trojan, perhaps under a different name. Remove it as follows.
    Malware is constantly changing to get around the defenses against it. The instructions in this comment are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "VSearch" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    /Library/LaunchDaemons/Jack.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /Library/PrivilegedHelperTools/Jack
    /System/Library/Frameworks/VSearch.framework
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot" or "Conduit" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    This trojan is distributed on illegal websites that traffic in pirated movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect much worse to happen in the future.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the DownLite developer has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing, has not done so, even though it's aware of the problem. This failure of oversight is inexcusable and has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Acrobat PDF Printer STILL freezes when pasting filename into Save dialog

    Ref: Acrobat Printer Freezes on Save when CTL+V is used
    No change in Acrobat X.  Printing system still freezes up entirely when pasting a filename into the Save dialog, when printing to Adobe PDF printer.  Most often from Firefix (all versions through 28.0) but from other programs as well (also happens from MS Outlook 2010 32 bit).
    Any chance of an update from Adobe?
    Acrobat Pro X on Win 7 64 bit.  Multiple systems exhibit same behavior.
    Same issue occurs in Acrobat XI Standard.
    Workaround is possible by manually typing in filename, or renaming, but clearly this should not be happening.  If you forget, it requires a lot of steps (or a reboot) to try again.

    If you copy text directly from FireFox (or Word, or pretty much any program, other than Notepad), and try to paste into the Save Dialog to save your PDF, guaranteed crash.
    HOWEVER, if you paste the text into Notepad first, and then copy it again, you can then paste into the Save dialog no problem.  This is why the "test" that the Adobe rep did to recreate the problem was pointless: He managed to re-create the one workaround method that DOES work, instead of actually trying to do things the way that were causing the issue to show up.
    The problem appears to be related to any sort of "rich" text.  Windows ignores the "rich" information and only keeps the text if you paste into a filename in the system.  So Windows handles it just fine, it's Adobe's save dialog that can't handle it.  Copied text from Firefox is usually pretty clean (IE is worse), but there must be some formatting remnants in there that are giving Adobe fits (instead of properly ignoring them).  It may have something to do with 64-bit Windows and 32-bit Firefox and 64-bit Acrobat all coming together?  Copying and pasting between 64-bit and 32-bit programs usually has no issues, but in this case, it does (although the 64/32 bit relation is pure speculation on my end).
    But by "washing" your text through Notepad first, it completely strips it down to truly pure plain text, which can then be pasted into Adobe's Save dialog without a crash.  This adds an extra step, and should be entirely unnecessary, but it does work.  At least until Adobe fixes their program.

  • Changing filename of hyperlink

    Hi - Is there a way to set up hyperlinks to files without iWeb inserting the filename into the web page? The filenames of my pdf documents that I want to link to tend to be very long and I would prefer to use some generic text, say "(pdf)", for people to click on.
    Thanks a bunch!
    MacBook Pro Mac OS X (10.4.8)

    check this video tutorial:
    http://karreth.com/files/hyperlinks.mov
    here for all
    http://karreth.com/iweb
    max
    From the Apple Terms Of Use I must state to provide this link: I may receive some form of compensation, financial or otherwise, from my recommendation or link

  • Make photo grid objects into links?

    I would like to make the photos and captions in the photo grid into links. When I select a photo or a caption in the photo grid, the link inspector is grayed out and I can not click "enable hyperlink". Every thing works fine for images and text not in the photo grid. Is it possible to do this?

    That is the way photo page works, photo grid thumbnails can not be hyperlinked because they are rendered by javascript widget. But you can put a full URL in thumbnail caption and it is hyperlink as discussed in this thread:
    http://discussions.apple.com/thread.jspa?messageID=7358077&#7358077
    However, when you click on the thumbnail to go to detail view, the caption is no longer a hyperlink; because caption in detail view is rendered by javascript widget.
    That said, what you like to do is very possible but you need to have very good understanding how photo page widgets work and a lot of javascript. Here is one of my example:
    http://widgets.cyclosaurus.com/Lytebox/Photos.html
    All thumbnail image links in the page had been changed using javascript.
    Send them a feedback: http://www.apple.com/feedback/iweb.html

  • Inserting current pathname and filename into Pages documents?????

    Pages help explicitly says you can put "filenames" and "pathnames" into formatted text fields just as you can put in page numbers and the date. It does NOT tell you how to do this!!! What do I type so that my current pathname appears in pages? Or the current filename of my document?? I am trying to create a template so that filename, pathname, date, and number of pages always appears in the header.

    Well, it is possible to automatically insert the document's filename into the header as I routinely do it in (dare I say) Microsoft Word and Microsoft Excel. I write many documents long and short. For each of them I start with the same template, one that includes the filename and the date "last saved" in the header.
    Those who have an ironclad hierarchy where every file is unambiguously filed into one folder might easily be able to retrieve every file. For me, it is very useful to know the filename of the document I am searching for (as it is on my hardcopy) and to know that it is "sept-mon-rpt-final" and not "sept-mon-rpt-mikes-edits". As my example suggests, the greatest utility of this is for version control.
    I do not want to type my filename into every draft document, I want them to insert themselves in the header in the same manner that Pages inserts the current date. This information, filename and pathname, is in the Mac system. Indeed, there is a reference to it in the Pages documentation.
    In Pages'08 Help - the page titled: "Working with Document Parts" under "using Headers and Footers" it says, "Add headers and footers to give your documents page-by-page identity by showing the date and time, page number, or filename and pathname."
    When you click on the link that says "Using Headers and Footers" you are taken to that page, where it says, "you can put your own text or graphics in a header or footer, and you can use formatted text fields. Formatted text fields allow you to insert text that is automatically updated. For example, inserting the date field shows the current date whenever you open the document. Similarly, page number fields keep track of page numbers as you add or delete pages."
    After this you hit a dead end.

  • Turn stacks into links?

    Hey =)
    Is it possible to change these stacks:
    http://i44.tinypic.com/4vjlz4.png
    into links so when I click on them, instead of the stack poping up, it would actually open in a finder window?
    Thanks...

    if you command+click on a stack it will open in a finder window. or you can put an alias to a folder instead of the folder itself on the dock and that will always open as a finder window with a single click.

  • Changing filename in configuration

    hi there,
    my question is can we change filename of a file in the configuration without using IR(that means no mapping was done)? the scenario is a simple file to file , the only problem is that the filename must be changed.
    is it possible to do this without using a udf(dynamic configuration)?
    thanks.
    ali

    thanks abhishek and srnivas .
    however in my scenario the  sender channel is picking 3 different files that is three files with different names. if i do as you stated, srinivas, all the output files will have the same name, rite?
    e.g
    file1.csv  ---> file1.csv
    file2.csv -
    > file.csv
    file3.csv -
    > file3.csv
    as it can noticed onlyfile2.csv must be changed to file.csv. is it possible to do the above in the configuration itself without using an UDF?
    thanks

  • No longer able to insert filename into a document in the new pages

    Does anyone know if the ability to insert the filename into the document has been eliminated or if we just have to get to it another way? Used to be able to go to INSERT>FILENAME but that seems to have disappeared.
    Thanks
    AJ

    It does cause problems in a number of circumstances.
    In this forum alone, there are several threads with many users who used Setup Assistant or Migration Assistant to transfer their stuff, ended up with lots of duplicate apps because of it, and had great difficulty finding and deleting the duplicates.
    There have also been folks whose apps did't get updated, and Adobe apps that wouldn't run at all.
    Again, it depends on the apps and circumstances.

  • How to Change Spry Menu Links

    I have a Spry Horizontal Menu on my page, and have a few
    questions on creating customized Links:
    - I know how to add a Link to my Reports, Pages, etc using
    the Link Properties box
    - I also know how to open the Link in a _blank page using the
    Target property box
    But
    - How do I change the Menu Link in code to open my new page
    in a smaller, new window?
    (Right now, the TicketSummaryAcct.cfm page opens up fine, in
    a new "full-sized" window)
    Here is the code currently listed under that Menu button:
    <li><a href ="reports/TicketSummaryAcct.cfm"
    title="Click here to print the report by Account Number to PDF"
    target=>_blank">by Acct# Prompt</a></li>
    Thanks,
    jlig

    In the header of the webpage:
    <script type="text/javascript">
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "',
    'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=300 ');");
    </script>
    in the link section:
    javascript:popUp('reports/TicketSummaryAcct.cfm')
    don't use a target attribute, as it will break the javascript
    in my experience. If you are using the pop-ups in more than 1
    webpage, or even for good programming practices, make a function
    page.
    Webpage name: newWindow.js
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "',
    'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=300 ');");
    And then in the header of the webpage(s) that you need the
    popup for, add this:
    <script src="newWindow.js"
    type="text/javascript"></script>

  • How can I change an embedded link to a website in a pdf in Pro XI

    How can I change an embedded link to a website in a pdf in Pro XI for Mac?

    Hi leee4227078,
    Please refer this blog post as this could help you on how to remove embedded hyperlinks:
    Removing Hyperlinks from a PDF and Feature/Gotcha
    Let me know.
    Regards,
    Anubha

  • How can I change an embedded link to a website in a pdf

    How can I change an embedded link to a website in a pdf in Pro XI for Mac?

    You can use the Select Object tool to select the link object and then right-click it and edit it via Properties.

  • How to Change text of link in SRM

    Hi All,
    How to Change text of link in SRM . The Link is in leftside of the screen in webportal.
    I needs to change the text of link ' Shop' , 'Check Status'  and 'Confirm Goods / Services.
    Kindly helpout me.

    Hi Rob,
    Thanks a lot for reply.
    You are right i am suppose to change in BBPGLOBAL.
    But i am not getting where should i change.I am unable to find the parameter in BPGLOBAL.
    Kindly advise me.
    Regards,
    Vasu

  • How to change the Hyper links color in the XML form

    HI SDNs
    Do u have any idea how to change the hyperlink color in the xml form. My requirement is as follows.I have created xml form by using xml template and i displayed this xml form by using Km document iview.  I need tochange the hyper link color in the xml form content. I dont want to go for manual process by editing the xml form. because i have several hundreds of xml forms.
    Appreciate if you give suggestion.
    Thanks
    Ramana

    Hi Ramana,
    The most convenient way to change the hyper links is by using the Theme Editor. Go to System Administration --> Portal Display --> Select Theme --> Component-Specific Styles --> Links --> Function/Result Link.
    Hope this helps.
    Kind regards,
    Joost

Maybe you are looking for

  • ICal Alarm Editing Bug, not fixed yet in 10.5.3?

    Hi All Mac users, I have noticed this bug for quite a long while, which I cannot remember from when, but I think it was from around 10.3 or 10.4. I am used to it, and can deal with this since I know it. But, it still seems to persist even after updat

  • EJB 3.0 Session Bean Remote Client

    Hi, I am planning to migrate my EJB 2.1 to EJB 3.0. My old session bean is accessed by a remote java client. I just have to include this piece of code: Hashtable props = new  Hashtable(); props.put("java.naming.factory.initial", com.sun.jndi.cosnamin

  • How to configure sun application server 8.2 for Oracle RAC 10g

    Hello, We have numerous boxes running the sun platform application server 8.2 and 2 boxes running enterprise version 8.2 all connecting to a 4 node Oracle RAC 10 G release 2 database. We have the system up and working. The application servers are con

  • GRC AC 10 - Change default value for field in access request

    Hi everybody in Access request,  Is it possible to change the defaut value in the fied "request for" ? thanks Aurélien

  • How to Turn Off Undo Closed Tab

    As the title says, I am finding this feature to be very annoying and I would like to be able to disable this. It was never present in previous versions so I am hoping somewhere is just as annoyed with this new feature as I am. Does anyone know anyway