Change specific link path between the documents.

I write a simple script to change the path for a certain number of links across multiple documents. I get an error "filePath is a read-only property" for the 7 line, even if I'm not trying to rewrite it directly. Any help would be greatly appreciated. Thank you!

var myDocument = app.activeDocument;
var oldPath = "G:\\Users\\My PC\\Desktop\\";
var newPath = "G:\\Users\\My PC\\Desktop\\New Folder\\";
for (a=0; a < myDocument.links.length; a++) {
    var currentLink = myDocument.links[a];
    var linkName = currentLink.name;
    if (currentLink.filePath = oldPath) {
        var myNewFile = new File(newPath + linkName);
        currentLink.relink(myNewFile);
        };
    }; 

Hi try Cambi code below

myDocument var = app.activeDocument;

oldPath var = new File ("C:\\");

newPath = "E:\\New folder\\"; var

for (a = 0;< mydocument.links.length;="" a++)="">

var currentLink = myDocument.links [a];

var Nom_de_lien = currentLink.name;

var linkPath = new queue (currentLink.filePath);

If ((linkPath.parent.toString () == oldPath) {}

var myNewFile = new File (newPath + linkName);

currentLink.relink (myNewFile);

};

};

Tags: InDesign

Similar Questions

  • JS CS4 share the path to the document

    I'm trying to divide the path of the document file so that I can navigate to one or two files, then in a specific subfolder.

    When I try to divide the "myDoc.filePath" it errors. If I shared "myDoc.name", it works correctly.

    myDoc var = app.activeDocument;
    var myDocPath = myDoc.filePath;
    mySplit var = myDoc.name.indexOf ('_');
    var myFileName = myDoc.name.slice (0, mySplit);
    var myPdfFolder = myFileName + "pdf";
    var mySavePath = myDocPath
    var mySplit2 = myDoc.filePath.indexOf (myFileName);
    var myFinalPath = myDoc.filePath.slice (0, mySplit2) + myFileName + "/" + myPdfFolder;
    Alert (myFinalPath);
    Can someone shed some light on how to divide the path of the document?
    Thank you
    John

    Path: ~desktop/N123456/working/N123456_01

    Note: the name of the last still non-existent folder. Often the 'work' folder is the last. Working folder and N123456pdf are at the same level.

    Goal is to change the economy to the path of the document: ~desktop/N123456/N123456pdf

    You will have about it the hard way.

    Work better with the property of the parent file (which is the folder that contains the file), and then it's the parent.

    The specific question that you are using is slice works on strings and you try to use it on a file object.

    Dave

  • Questions asked by a beginning.  CF, HTML, change of name/path of the folder and the addition of home page.


    Questions asked by a beginning. CF, HTML, change of name/path of the folder and the addition of home page.
    Hello, I got this new job and I'm trying to understand it as soon as possible. I'm a complete newbie to html, CF and web development
    Yes, I caught a few books, but if you can help me. I appreciate a lot is.

    I have this file structure
    Z:\ToExport\RepDocs\MyReport
    Pointing to this one
    http://myserver/MyReport/
    You will find a folder of MyReport
    And find 2 .cfm
    1 index
    2 version.cfm
    I have 2 BIG questions, ok 3

    HOW TO MAKE A PAGE THAT WILL CONTAIN
    The link of this MyReport.
    A home page. In other words.

    Homepage that contains a main report text
    Name of the division_

    Then a link called my reports. And your report
    Prefereably sorting

    · My reports.
    · Your report


    HOW CAN I CHANGE THE FOLDER
    Of
    Z:\ToExport\RepDocs\MyReport
    Pointing to this one
    http://myserver/MyReport/
    TO
    Z:\NewExport\repmining\myreport

    And then tap on it
    http://myserver/ repmining\myreport


    WHY IS THE REPDOCS NOT TYPED IN THE BROWSER WHEN YOU VIEW the MYREPORT. (I don't have to type (repdocs) to view the report)?
    in other words:
    Z:\ToExport\RepDocs\MyReport
    Is typed
    http://myserver/MyReport/

    without repdocs.

    Please excuse me.
    I am a true beginner.

    Thank you.
    Hope someone replies soon.
    Take care.

    OK, I think I understand your questions, so here:

    Quote:
    HOW TO MAKE A PAGE THAT WILL CONTAIN
    The link of this MyReport.

    Just have a link on a page, e.g.:
    TEXT of the LINK,
    As for your question on your reports, I don't understand what you're asking

    Quote:
    HOW CAN I CHANGE THE FOLDER
    Of
    Z:\ToExport\RepDocs\MyReport
    Pointing to this one
    http://myserver/MyReport/
    TO
    Z:\NewExport\repmining\myreport

    And then tap on it
    http://myserver/ repmining\myreport

    If you are directly connected to the server, simply create a folder (what looks like) Z:\ToExport\RepDocs\ which is the new name of Fortin, ex:
    Z:\ToExport\RepDocs\NEW_folder and put the files into it. If you are now directly connected to the server, use a program such as FTP server to connect via FTP and do the same thing.

    Quote:
    WHY IS THE REPDOCS NOT TYPED IN THE BROWSER WHEN YOU VIEW the MYREPORT. (I don't have to type (repdocs) to view the report)?
    in other words:
    Z:\ToExport\RepDocs\MyReport
    Is typed
    http://myserver/MyReport/

    It is simply because http://myserver/Myreport/ is set to point to the Z:\ToExport\RepDocs\MyReport file so it looks http://myserver is set on the Z:\ToExport\RepDocs\ folder anything you add to a folder which will be included.

    I have IE hop answered some of your questions

  • I want to insert the path to the documents in the header, how to accomplish this?

    I'm trying to implement a standard header for all work related documents. In the header, I need to show the path to the document. I use to have a model which included the path but I ain't. Is it possible to make a template for a header that displays the path to the document? If yes how?

    It would depend on your word processing program.  Almost all offer headers and many offer various 'macro' features that can insert information in the header.  See the documentation of your word processing program or find a forum that takes care of your word processing software and ask there.

  • How to check if a link located in a folder called links next to the document?

    How to check if a link located in a folder called links next to the document?

    myDocument var = app.activeDocument;

    for (var myCounter = 0; myCounter < myDocument.allGraphics.length; ++ myCounter)

    {

    var myGraphic = myDocument.allGraphics [myCounter];

    If (myGraphic.itemLink.status! = LinkStatus.linkMissing)

    {

    If (myGraphic.itemLink.filePath is outside the folder 'Links' which lie next to this document)

    {

    }

    }

    }

    Main();
    
    function Main() {
        var i, link,
        doc = app.activeDocument,
        linksPath = doc.filePath.fsName + "\\Links",
        links = doc.links;
    
        for (var i = 0; i < links.length; i++) {
            link = links[i];
            if(link.status != LinkStatus.linkMissing) {
                if (File(link.filePath).parent.fsName === linksPath) {
                    $.writeln(i + " - " + link.name + " - is inside 'Links' folder");
                }
                else {
                    $.writeln(i + " - " + link.name + " - is outside 'Links' folder");
                }
            }
        }
    }
    
  • Hierarchical Oracle query help needed - path between the crux of two brothers and sisters

    I want to find the path between two nodes of oracle hierarchical Table.

    Consider the following case-
    NodeId - ParentId
    =============
    1 > > > > > > 0
    2 > > > > > > 1
    3 > > > > > > 2
    4 > > > > > > 3
    5 > > > > > > 0
    6 > > > > > > 5
    Here I want to query the database table that if there is a path between nodes 3 and 5?
    The previous query you provided work upwards to the root node.

    Here is my expected result, 3-> 2-> 1-> 0-> 5

    Yet once if I have a query in the table to get the path between 1 and 3, I want to get out of the way - next
    1-> 2-> 3

    Therefore, the query works in both cases. Where ADI root can act as an intermediate or no node.

    Can you please guide me how I can get it?

    Thank you.

    Hello

    user13276471 wrote:
    I want to find the path between two nodes of oracle hierarchical Table.

    Consider the following case-
    NodeId - ParentId
    =============
    1 >>>>>> 0
    2 >>>>>> 1
    3 >>>>>> 2
    4 >>>>>> 3
    5 >>>>>> 0
    6 >>>>>> 5
    Here I want to query the database table that if there is a path between nodes 3 and 5?
    The previous query

    What application is this? If you're referering to another thread, then post a link, such as {message identifier: = 10769125}

    you provided work upwards to the root node.

    Here is my expected result, 3--> 2--> 1--> 0--> 5

    Yet once if I have a query in the table to get the path between 1 and 3, I want to get out of the way - next
    1--> 2--> 3

    Therefore, the query works in both cases. Where ADI root can act as an intermediate or no node.

    Can you please guide me how I can get it?

    I think you want something like this:

    WITH     bottom_up_from_src    AS
    (
         SELECT     nodeid
         ,     parentid
         FROM     table_x
         START WITH     nodeid      = :src_nodeid
         CONNECT BY     nodeid   = PRIOR parentid
    )
    ,     bottom_up_from_dst     AS
    (
         SELECT     *
         FROM     bottom_up_from_src
        UNION ALL
         SELECT     parentid     AS nodeid
         ,     nodeid          AS parentid
         FROM     table_x
         WHERE     nodeid     NOT IN (
                                          SELECT  nodeid
                                   FROM    bottom_up_from_src
                                      )
         START WITH     nodeid        = :dst_nodeid
         CONNECT BY     nodeid        = PRIOR parentid
    )
    SELECT      :src_nodeid || SYS_CONNECT_BY_PATH (parentid, '-->')     AS display_path
    FROM       bottom_up_from_dst
    WHERE       parentid     = :dst_nodeid
    START WITH  nodeid     = :src_nodeid
    CONNECT BY  nodeid     = PRIOR parentid
    ;
    

    This will show how you can get it from: src_nodeid at dst_nodeid, moving to the top or to the bottom of a hierarchy at a time step. This will work regardless of the fact that


    • : src_nodeid is the ancestor of the: dst_nodeid, or
    • : src_nodeid is a descendant of: dst_nodeid, or
    • both: src_nodeid and: dst_nodeid are the descendants of another node (e.g. 0).

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0). It is always important, but particularly so with CONNECT BY queries, because each version since Oracle 7 had significant improvements in this area.
    See the FAQ forum {message identifier: = 9360002}

  • Add a link to open the document

    Hello

    How to add a link to open a document in the same browser.

    Hello

    Run the following code

    
    
      
      
        
          
            
          
        
      
    
    

    It will open the site of oracle in the same browser

    Thank you
    Prateek

  • Why numbered lists will not continue between the documents in a book?

    Dear community InDesign,

    I am nearing completion of a volume of 1100 page, organized in book form in ID CS6 (OS X) composed of about 15 different documents. According to the excellent orientation in those discussions, I used a paragraph style to generate via the numbered lists figure captions.

    For some reason, numbered lists restart between sequential in the book chapters, while I need them to continue between the blocks specified documents. Please note that I already have:

    1. Define continues numbered lists from previous documents
    2. Go to Type > > bulleted and numbered lists > > define lists > > edit list to verify that 'continue Document numbers in previous book' is checked
    3. Synchronize all documents in the book and updated the numbering via the book panel
    4. Read a lot of discussion on this site to try to locate this problem without success (but if you have a lead, I'm more excited to see)

    Any suggestions would be welcome; I put things up through the proverbial book, and it seems that simply check the box "Numbers continue" should be enough, but it isn't.

    Thanks a lot for your help.

    S.

    There is a Update Page and Section numbers - and there is also an "update chapter and paragraph numbers.

    Thing is to check that the numbering is set to follow the previous book - and then refresh the chapter and the numbering of the paragraphs.

    Which solves the problem?

  • How to change a link according to the mounting position?

    Hi all

    I am very new to javascript, and I'm doing different slides of the slide show that each link to URL.

    It's usually very simple onboard, but my problem is that I also have a PNG that "frames" the slides, and the PNG is positioned above the DIV holding the blades themselves. That's why I can't use the traditional 'click' of behavior for slides as PNG "mask" the clickable area.

    My idea was to place an invisible rectangle over the area that I want to be clickable with a link that changes with the timeline.

    First of all:

    I created an action click (with no code in it) for the new clickable rectangle (div name = 'click-box');

    Second:

    On the timeline, first image, I wrote this code to assign the URL to the click:

    var BannerLink = sym.lookupSelector('click-box');

    $(BannerLink) .append ($(' < un style = "display: block;) width: 100%; (("height: 100%;" href = "http://WWW.EXAMPLE-URL-1.COM/" target = "_blank" rel = "nofollow" / > '));

    Then over different periods of time line, I added code even, but with different URLS, like this:

    Frame10:

    var BannerLink = sym.lookupSelector('click-box');

    $(BannerLink) .append ($(' < un style = "display: block;) width: 100%; (("height: 100%;" href = "http://WWW.EXAMPLE-URL-2.COM/" target = "_blank" rel = "nofollow" / > '));

    Section 11:

    var BannerLink = sym.lookupSelector('click-box');

    $(BannerLink) .append ($(' < un style = "display: block;) width: 100%; (("height: 100%;" href = "http://WWW.EXAMPLE-URL-3.COM/" target = "_blank" rel = "nofollow" / > '));

    It did not work.

    During execution of the composition of the edge, all the frames, click on the link only to the first link 'www.EXAMPLE-URL-1.COM '.

    If my code is wrong. Any ideas on how to do this?

    Thank you.

    Post edited by: DMConsulting

    Thanks Joel,

    I was able to resolve the issue with the link you gave me.

    Basically i:

    1. Set the action to click for the object that I wanted to be clickable:
      Window.Open (sym.getVariable ("bannerURL"), '_blank');
    2. on the first image, I have added this code to the chronology of the actions:
      sym.setVariable ("bannerURL", "http://www.DUMMY-URL-1.org/");
    3. on the following pictures I just add variables updated, like this:
      sym.setVariable ("bannerURL", "http://www.DUMMY-URL-2.org/");

      thus changing the variable of the timeline.

    Thank you very much.

  • Is it possible to reset the path between the location it is source clip life so that when repositioning back it goes back to the item in a specific location and a clip?

    We had to redo our bins stage because not all clips imported via the media browser, and now that we brought manually with hand cursor via the browser of media elements in the sequence link clips in strange tubs that are not records bin stage.  We want to the difficulty of these paths if possible.

    '

    Select the item in the timeline panel.

    Once selected, right-click (Ctrl-click) on the clip and the drop-down list that appears, choose "reveal in project.

    The source of the item in the timeline is now highlighted in the project Panel, and then you can move this clip in the project to the bin that you want to put in it.

    MtD

  • icons change size and move between the start up... Why?

    I move and resize the icons on my desktop... then, if I stop and restart the computer, the icons are in a different size and location where I want.  What arrangement made change to make that happen? I am the only user on the computer. Vista Home Premium.

    Hello

    I would like the season you try these methods and check.

    Method 1:

    Make the SFC scan and check the status of the issue.

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

    http://support.Microsoft.com/kb/929833

    Method 2:

    You can check if you are facing the same question in the user account new or different administrator account. You can create a new user account on your computer, and then check.

    Create a new user account-
    http://Windows.Microsoft.com/en-us/Windows7/create-a-user-account

    If you are not faced with the same question in a new user account, you can view the link below and use the steps provided to fix a corrupted - user profile
    http://Windows.Microsoft.com/en-us/Windows7/fix-a-corrupted-user-profile

  • Flash CS5 - relative path of the document class and the location of the package

    It seems that I have no trouble to my class a FLA document class project when the FLA is the same root in the root directory of the package. However, if the FLA is nested within a subdirectory, then paths relative to a nested class in the package will not work.

    location of package & sample class: com.company.project.ClassName

    CASES1:

    Package location: \MyProject

    The FLA location: \MyProject

    where is the path of document class: ""./com/company/project " "

    Case 2 (does not work):

    Package location: \MyProject

    Location of the FLA: \MyProject\MySubFolder

    where is the path of document class: "... / com/company/project"

    If someone can provide an explanation as to why nested FLAs cannot point to custom packages to parent directories level OR show how this can be done, it would be much appreciated.

    Now that I think about, the two paths are relative, which makes it more confusing.

    Thank you.

    It works for me: http://www.kglad.com/Files/forums/tt.zip

  • document.referrer returns the path of the page

    I have a page that is loaded through apps.facebook.com

    There are two ways that this page is accessible from:
    apps.facebook.com/ProductionPage
    apps.facebook.com/DevelopmentPage
    (Not the URL, just used for example)

    I used document.referrer to determine if the page has been loaded through the path of development and if so load of debug code. Now firefox has been updated document.referrer returns the domain without the path. Is there way or workarounds to get the path of the document.referrer?

    Thank you
    Armand Choy

    The solution most obvious workaround seems to be to add a parameter to the URL that you use to embed in the page, assuming that FB that allows.

  • Relative paths of the gateway requirements

    So I am using requirements gateway for a little while now and I are one of several developers to use, or one of the many people now the documents it contains.  We keep the Gateway project control requirements of source code with the documents and the project code in that respect.

    We met one of the problems was that this gateway requirements is configured as an absolute path if the path is not under the gateway requirements project path.

    Let's say I have a directory like this structure.

    \Requirements Gateway\ Q:\Project\Project [x]

    [X] Q:\Project\Project [x] \Project Documentation\

    Q:\Project\Project [x] Code\ [x] \Project

    When you add documents to the gateway requirements project it will add them however travel.  So if another developer gets the source on the V:\ drive control then it can not find documents or code.  We found that you can manually change the path of the documents to have a relative path by editing the .rqtf file manually in a text editor.

    Finally the problem.  This solution does not work for code TestStand or paths of LabVIEW code... why?  If I replace "[x] [x] Code\ \Project Q:\Project\Project"with"[, \Project[x] Code\ ' in the .rqtf project file and then open the project, it will say file not found.  The file may have been moved or deleted.  But all the documents that are configured to have relative paths work fine.

    Can someone tell me how to get access roads-related work for LabVIEW and TestStand code in Gateway requirements?  Thank you.

    Hooovahh-

    It is currently a lack of functionality for our types of TestStand and LabVIEW OR gateway 1.1 requirements. This is something that will probably fix us in the next version or Gateway requirements.

    Thank you for that bring to our attention.

  • All paths between 2 nodes

    Hello

    Can you get it someone please let me know how can I achieve this?

    I want to know all the paths between A Source node and the node of Destination B.

    I donot want the shortest way but all paths between the 2 nodes.

    Also I donot have no weight/cost by any path. (The graph is a directed graph)

    Kind regards
    Pantxo

    Hello

    Maybe this:

    Scott@my11g SQL>l
      1  with links(n1,n2) as (
      2  select 'A','B' from dual
      3  union all select 'A','C' from dual
      4  union all select 'B','C' from dual
      5  union all select 'B','D' from dual
      6  union all select 'D','G' from dual
      7  union all select 'C','G' from dual
      8  union all select 'D','I' from dual
      9  union all select 'C','E' from dual
     10  union all select 'E','F' from dual
     11  union all select 'F','G' from dual
     12  union all select 'F','H' from dual
     13  )
     14  select pth
     15  from (
     16  select connect_by_root(n1) || sys_connect_by_path(n2,'>') pth ,n2
     17  from links
     18  start with n1='A'
     19  connect by nocycle prior n2=n1
     20  )
     21* where n2='G'
    Scott@my11g SQL>/
    
    PTH
    ----------------------------------------
    A>B>C>E>F>G
    A>B>C>G
    A>B>D>G
    A>C>E>F>G
    A>C>G
    

Maybe you are looking for

  • update of Firefox not offered for windows 7

    Hello... I love your browser and do it running on all my machines! I currently use on my bench of FreeBSD, my Windows 7 and Windows 8 platforms too. I always make sure to check updates every few days because I know how important keeping connected to

  • Satellite Pro A60: Generic Host Process for Win32 Services has encountered a problem

    Satellite Pro A60 - Win XP Pro SP2.I recently started getting this error: "Generic Host Process for Win32 Services has encountered a problem and needs to close." We are sorry for the inconvenience. » and I was wondering if there are any known issues

  • iOS 9.2.1 group messaging iphone

    Since my phone update to 9.2.1 I can't let a group text.  Does anyone else have this problem? I do not have a separate conversation thread and I keep getting texts of all referring to the same message.  iPhone 6 more. Any ideas?

  • Multi screen vs Single Manager

    Hi all What is the best way to create a like LinkedIn, Twitter with the top tool bar applications. Is it better to have a screen a lot, to push and pop whenever you click the toolbar button? or one screen with the toolbar and field Manager come and g

  • Muse error: could not find the UID breakpoint

    Error messageWhile trying to open an old updated Muse CC with Muse CC 2015 project, I got the above error message.-Josiah