Skip to content

Corrie Potter

My feedback

2 results found

  1. 6 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    Corrie Potter supported this idea  · 
  2. 97 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Corrie Potter commented  · 

    //Script will update the document's links based upon its current location.
    var doc = app.activeDocument;
    updateLinksRelativeToDocument(doc);
    function updateLinksRelativeToDocument(doc){
    var docLinksFolder = new Folder(doc.filePath + '/Links');
    var docLinksFolderFiles = docLinksFolder.getFiles();

    var docLinks = doc.links;
    for(l = 0; l < docLinks.length; l++){
    var link = docLinks[l];
    var newLink = findLinkRelativeToCurrentDocumentLocation(docLinksFolderFiles, link);
    if(newLink){
    link.relink(newLink);
    $.writeln('successfully relinked');
    }
    }
    }

    function findLinkRelativeToCurrentDocumentLocation(linksArray, link){
    var linkFile = link.name;
    for(var i = 0; i < linksArray.length; i++){
    var linkToSearch = linksArray[i];
    if(linkToSearch.toString().search(linkFile) > -1){
    var x = 0;
    return linkToSearch;
    }
    }
    return null;
    }

Feedback and Knowledge Base