Script to rename Link Info Names

I'm working on converting a clients old catalog from Quark to Indesign.  I'm using Indesign CS4 on Windows Vista. I've used Markzware Q2ID to convert the catalog to indesign with out too many problems.  But I have run into a big problems with the images.  They will not automatically relink.  After digging around I've found the problem.  For some reason all of the Image names also include the path structure.
For Example
Link Info
Name: BDA-12:Users:graeme:Desktop:FSIP back up:_Collected:02405 FSIP AftMkt EAST:Pictures:M587524.EPS
Path: BDA-12:Users:graeme:Desktop:FSIP back up:_Collected:02405 FSIP AftMkt EAST:Pictures:M587524.EPS
Luckly all the names have the same problem.  So I'm hoping to find or write a script that can simply go through the indesign document and Find/Replace all of the link names to remove "BDA-12:Users:graeme:Desktop:FSIP back up:_Collected:02405 FSIP AftMkt EAST:Pictures:".
I know this is a really simple problem but this is my first real attempt at scripting something in Adobe.  Does anyone have any good ideas or tips on how I would do this?
Thanks
Vic Bushfield

Victor,
The conversion program totally corrupted links in your document: myLink.filePath is just empty string, myLink.name is what should have been myLink.filePath (This is info from ESTK).
Here is a new version of the script -- it relinks to files located in NewLinks folder on the Desktop. Change this line
var myNewPath =  "~/Desktop/NewLinks/" + myName;
to location of your links.
Warning -- I tested this on Mac, since don't have a copy of CS4 for Windows.
Kasyan
#target indesign
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 myArr = myLink.name.split(":")
    var myName = myArr[myArr.length-1];
    var myNewPath =  "~/Desktop/NewLinks/" + myName;
    var myNewFile = new File(myNewPath);
    if (myNewFile.exists) {
        myLink.relink(myNewFile);
        myCounter++;
if (myCounter == 1) {
    alert("One file has been relinked.", "Finished");
else if  (myCounter > 1) {
    alert(myCounter + " files have been relinked.", "Finished");
else {
    alert("Nothing has been relinked.", "Finished");
function err(e, icon){
    alert(e, "Update path names script", icon);
    exit();

Similar Messages

  • Script for rename the pictures name as login names

    I have staff pictures (100+) and pictures name as ID of staff. But I want to rename all with login names. any idea of writing a script?
    Best
    lasantha

    Hi Lasantha,
    Please refer to the following post related to renaming user profile thumbnail.
    https://blogs.blackmarble.co.uk/blogs/rhepworth/post/2010/07/29/powershell-script-to-rename-files-for-use-as-sharepoint-2010-user-profile-thumbnails.aspx
    Please don't forget to mark it answered, if your problem resolved or helpful.

  • Using a script to rename a file from the file info cart Cut Num (ID)??

    Hi,
    Can any of you guys tell me if its poss to do a script to rename a wav with the file info, cart, Cut Num ID field....??? (Cart chunks)
    Example file at the moment is called {C5E5F0FE-57D9-4A9A-8DA1-58D1AE7017FD}.wav and I want to grab the info out of the File info, cart section, under Cut Num (ID) which has 9558 in it and rename the file so it is now 9558.wav when it saves or just renames it.I also then want to run the script as i have 6000 plus wav,s to do this too.
    Thanks for any info.
    Glen

    >Can any of you guys tell me if its poss to do a script to rename a wav with the file info, cart, Cut Num ID field....??? (Cart chunks)
    No, scripts in Audition won't let you do this at all. In fact, Audition's scripting function really isn't very file-friendly, relating pretty much just to basic Audition functionality. And there's no way that an Audition script would let you rename a file anyway - they the closest they get to handling any file-related functions is that you can open a designated noise reduction profile - but that's about it.
    There's one place that I know of where you might find a utility to do what you want -
    here (try WidgetPro).

  • 6.0.4 Update - fixes nested ID file links info

    Hi all,
    I got a message from an Adobe development manager letting me know of the 6.0.4 update. Specifically they have (almost) rectified the issue where you could not find out about graphic links inside of ID docs that were placed inside another ID document. The solution is that the placed ID document has an attribute of "links" (list/array) which can then be queried for the number of images and their information. I said "almost" because in a quick test, and verification with the Adobe rep, the Status of a graphic in the place ID file will not show as "normal" - it only shows its status as "out of date" or "link missing". My rep says this may need to wait for a later (6.0.5?) update.
    There may be other fixes but this is one of two I really needed. I wanted to let everyone know, I know there are some other people waiting for this.
    Here's some Applescript of how I queried some links in nested ID files:
    --comment out as needed
    tell application "Adobe InDesign CS4"
    tell document 1
    set subLinkTable to {}
    set topLinkStatii to status of every link
    if topLinkStatii contains link missing then --link missing is constant
    return "missing top level links"
    end if
    repeat with L in every link
    set linkCount to count of links of L
    repeat with i from 1 to linkCount
    copy ((status of link i of L) as string) & "-" & (name of link i of L) to end of subLinkTable
    if status of link i of L is link missing then
    return "missing 2nd level links"
    end if
    end repeat
    end repeat
    return "great success"
    end tell
    end tell
    Here's a javascript (not written by me) that does some similar querying:
    // Iterate through all the links of container document
    linksLength = theDoc.links.length;
    for (i=0 ; i< linksLength ; i++)
    var curLink = theDoc.links[i];
    alert("Top level link: " + curLink.name);
    childLinksLength = curLink.links.length;
    // Iterare through the child links of the placed INDD file
    for (j=0; j < childLinksLength; j++)
    alert("Child link: " + curLink.links[j].name);
    Ciao,
    Chris

    I've never been working with placed ID documents so I can't comment that. My concern is ordinary images.
    The thing that's breaking is the relinking of images in scripts, previously relying on an update and an assignment of the result of the update to a new variable, like this:
                lnk.relink(File(myImagesPath + '/' + newTrail));
                var modifiedLink = lnk.update();
                picture = modifiedLink.parent;
    A try/catch, not to disturb customers still in CS3 or not yet updated should take care of the error now.
    > I agree it causes us to change scripts; but that does happen from time to time.
    Well, major versions of course, but I don't agree that it happens time to time. Absolutely not. This is the first time ever that an ordinary minor (free) update has caused any of our scripts to fail (and we have quite a lot of code, doing scripting since CS2). We might just be lucky but I'd say that Adobe has been very good at not disturbing code by updates, and my guess is that the effect of this update was taken into account when released.

  • How to check the host name or rename the host name in Enterprise Manager

    Hello,
    How do i check the host name or rename the host name in Enterprise Manager for Oracle 11g?
    Regards,
    Ming Man

    there is a shell script called chgip or something
    like that is there . I used it for IAS. I beleive the
    same is there for database too
    Rajesh AlexIf there is, I have not been able to find it.
    Off the top of my head, changing the host name involves at least the following (others feel free to add on):
    For listener and connectivity
    - listener.ora
    - tnsnames.ora (on all clients as well)
    - potentially ldap.ora (on all clients as well)
    - init.ora parameter LOCAL_LISTENER
    For admin using Enterprise Manager (starting 10g)
    - the contents of the sysman schema
    - the directory name of the OEM agent directory
    - the directory name of the OEM OC4J config directory
    - various config files in the OEM OC4J config directory
    Oracle provides the emca to handle this last set.
    In addition, the following refer to hosts that are [probably] not local
    - init parameter REMOTE_LISTENER (usually just points to a tnsnames.ora entry naming remote hosts)
    - init parm SMTP_OUT_SERVER
    Again, adding to the list might be interesting.

  • Script to rename layers comps batch?

    Does anyone know any script to rename batch comps layers in a sequential numbering? For example: layerComps01, layerComps02, layerComps03 ...

    // 2014, use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
    for (var m = 0; m < myDocument.layerComps.length; m++) {
    myDocument.layerComps[m].name = "comp"+bufferNumberWithZeros(m+1, 2)
    ////// buffer number with zeros //////
    function bufferNumberWithZeros (number, places) {
      var theNumberString = String(number);
      for (var o = 0; o < (places - String(number).length); o++) {
      theNumberString = String("0" + theNumberString)
      return theNumberString

  • Is there a way to export link info (scale %, effective ppi, etc.) to a spreadsheet?

    We have several retail pieces that use the same images multiple times. We upsize the image to the largest scale that is used in multiple layouts and then use that same image in the smaller pieces. We'd like to be able to export the link info from several ID layouts to a spreadsheet to compare images and what scale they are needed. This would save time by having to open several files and manually compare scaling, etc.. Any ideas? Thanks!

    Not mine, but I don't know who wrote it originally.
    Add in your own needs... (i'm still learning JS so I haven't advanced this any further, but I want to add both actual dpi or effective (output size) dpi...)
    app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
    list = [];
    imgs = app.activeDocument.allGraphics;
    unitname = getCurrentUnit();
    for (i=0; i<imgs.length; i++)
    h = imgs[i].parent.geometricBounds[2] - imgs[i].parent.geometricBounds[0];
    w = imgs[i].parent.geometricBounds[3] - imgs[i].parent.geometricBounds[1];
    left = imgs[i].parent.geometricBounds[1];
    top = imgs[i].parent.geometricBounds[0];
    scale = roundMe(imgs[i].horizontalScale,1);
    // some fair rounding
    switch (unitname)
      case 'in':
       w = roundMe(w, 3);
       h = roundMe(h, 3);
       left = roundMe(left, 3);
       top = roundMe(top, 3);
       break;
      case 'cm':
       w = roundMe(w, 2);
       h = roundMe(h, 2);
       left = roundMe(left, 2);
       top = roundMe(top, 2);
       break;
      default:
       w = roundMe(w, 1);
       h = roundMe(h, 1);
       left = roundMe(left, 1);
       top = roundMe(top, 1);
    list.push (imgs[i].itemLink.name+'\t'+'('+left+','+top+')'+'\t'+w+' x '+h+' '+unitname+'\t'+scale+'%');
    // alert (list.join('\r')); exit();
    defaultFile = new File (Folder.myDocuments+"/"+app.activeDocument.name.replace(/\.indd$/i, '')+".txt");
    if (File.fs == "Windows")
    writeFile = defaultFile.saveDlg( 'Save report', "Plain text file:*.txt;All files:*.*" );
    else
    writeFile = defaultFile.saveDlg( 'Save report');
    if (writeFile != null)
    if (writeFile.open("w"))
      writeFile.encoding = "utf8";
      writeFile.write (list.join("\r")+"\r");
      writeFile.close();
    function roundMe(val,to)
    var t = 1;
    while (to-- > 0) t *= 10;
    return Math.round(val*t)/t;
    function getCurrentUnit ()
    switch (app.activeDocument.viewPreferences.horizontalMeasurementUnits)
      case MeasurementUnits.POINTS: return "pt";
      case MeasurementUnits.PICAS: return "pt";
      case MeasurementUnits.INCHES: return "in";
      case MeasurementUnits.INCHES_DECIMAL: return "in";
      case MeasurementUnits.MILLIMETERS: return "mm";
      case MeasurementUnits.CENTIMETERS: return "cm";
      case MeasurementUnits.CICEROS: return "c";
      case MeasurementUnits.AGATES: return "ag";
      default: alert ("Oh, come on!"); exit(0);

  • Why can't we copy from the Link Info box anymore in CS5 Indesign? arrrrgggggh!

    Hi does anyone know of an update so we can copy image numbers from the Link Info box in Indesign? We can't do this anymore in the CS5 upgrade..... and I'm so over typing out the long stock numbers to order hires images.  It takes too much time! Thanks for your help in advance! Cheers, - Mel

    Thanks. It would be great to have that old function back again - just grab what we need from the long file name and not have to open a second program to edit. Hope they consider that for next updates. Cheers!

  • Script for renaming selected shape layer items

    Does anyone know if such a script exists?
    That is to say, a script that renames the selected sub-items of a shape layer (paths, groups, shape generators etc).
    Am aware there's already scripts to rename selected layers and layer masks. Have attempted to rewrite these to deal with shape layer items, but to no avail.
    Many thanks

    I was able to rename them using these:
    "Path 1"
    app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Shape - Group").name = "MY NEW PATH NAME";
    "Shape 1"
    app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Stroke").name = "MY SHAPE NAME";
    "Fill 1"
    app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Fill").name = "MY FILL NAME";
    "Group 1"
    app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Group").name = "MY GROUP 1 NAME";

  • Script that take FTP Info.

    Required:
    1-     
    Script that take FTP Info. (Host – User Name – Password – file Path) and make a .TXT file Upload.
    2-     
    Script that Take FTP info. (Host – User Name – Password – Remote file Path – Local file Path) and Make Download
    Delivery: PowerShell Scripting File (.PS1)

    I'm sorry, I'm not clear if this relates to SharePoint.
    Do you have a specific problem with a script you have tried to implement?
    These forums are not a place for others to do your work for you, but instead work best when others assist you with technical problems you are having when using Microsoft technologies.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Script to renumber links in random order

    I have chapter 1 page with 50 small photos in a very orthodox and symmetric grid that I should repeat in a different random order for other chapters.
    Links have a numbered logical syntax like:
    pict1.tif
    pict2.tif
    etc.
    For the chapter 2, the idea is repeat the first one but in a random order. Same photos, same layout, different order.
    Perhaps a script could rename the links?
    Thus, once the folder is duplicated I will have a second folder:
    picture 1.tif is now, for example, pict45.tif
    picture2.tif.is now, for example, pict13.tif
    etc.
    IF I relink a copy of chapter 1 to this second folder perhaps the idea could be solved.

    Jarek, hi.
    It works when it is only ONE picture by page.
    But, with many pictures in the page, as in the example, the script is dead.
    (no error at all)
    I have six pages with the same grid of pictures repeated in a file.
    The idea is that in p. 2, 3, etc, the script alters the order in random to have different positions.
    Tried different combinations but were useless.
    Thanks.
    PD. The screenshots show the script working with single images.

  • Script to rename tv show with season and episode number

    Hi all,
    I am working on a script to rename all the files of a tv show contain into a single folder - keeping season & episodes numbers.
    I am using zenity to get the correct name of the tv show (mainly to add capital letters, and remove the dots - and also to be able to use the script for different tv show)
    then again using zenity to select which folder contain the files, and then I want zenity to display how the rename will do as a verification and if happy then process.
    The script work great but I can get zenity to display the output of the command and ask the question.
    Any suggestion?
    Many thanks,
    Regards,
    #!/bin/bash
    #Use Zenity to capture the title of the TV Show
    tv_show_name=$(zenity --entry)
    #Select folder where the files to be rename are
    sourcefolder=$(zenity --file-selection --directory --title "Please select the folder containing those Files")
    #Move into the folder
    cd $sourcefolder
    #Now we execute the script to keep season and episode numbers
    if [ $? == 1 ]; then exit; fi
    for filename in *; do
    if [[ "$filename" =~(\**).*(.*[0-9][0-9]).*([0-9][0-9]).*(\....)$ ]]; then
    result=$(`echo mv "$filename" "$tv_show_name S${BASH_REMATCH[2]} E${BASH_REMATCH[3]}${BASH_REMATCH[4]}"`)
    zenity --question --title="Are those title correct?" \
    --text=$result \
    if [[ $? -eq 0 ]] ; then exit; fi
    else
    mv "$filename" "$tv_show_name S${BASH_REMATCH[2]} E${BASH_REMATCH[3]}${BASH_REMATCH[4]}")
    fi
    done
    exit

    Right,
    I finally got it!
    Now the script work (tested with multiple files, different names) and the verification is to a singles files just to be sure not the mess up those episodes number.
    #!/bin/bash
    #Use Zenity to capture the title of the TV Show
    tv_show_name=$(zenity --entry)
    #Select folder where the files to be rename are
    sourcefolder=$(zenity --file-selection --directory --title "Please select the folder containing those Files")
    #Move into the folder
    cd "$sourcefolder"
    #Now we execute the script to keep season and episode numbers
    if [ $? == 1 ]; then
    exit
    fi
    for filename in *; do
    if [[ "$filename" =~(\**).*(.*[0-9][0-9]).*([0-9][0-9]).*(\....)$ ]]; then
    result=$(echo mv \"$filename\" \"$tv_show_name S${BASH_REMATCH[2]} E${BASH_REMATCH[3]}${BASH_REMATCH[4]}\")
    zenity --question --title="Are those title correct?" \
    --text="$result" \
    if [[ $? == 0 ]] ; then
    mv "$filename" "$tv_show_name S${BASH_REMATCH[2]} E${BASH_REMATCH[3]}${BASH_REMATCH[4]}"
    fi
    fi
    done
    exit

  • Best way to Restore Database to create a new Database having different dependent objects like linked server names in the procedures

    Hi All,
    Am creating a new test server by cloning the production server. Creating Dbs by restoring the production backup but wondering is there any best way to update the linked server names in open query of few SPs other than manual checking and updating.
    Thanks,
    Swapna

    It will not update the stored procedure rather it generates the scripts. You can validate and execute the script later.
    Try this link
    http://www.ideosity.com/ourblog/post/ideosphere-blog/2013/06/14/how-to-find-and-replace-text-in-all-stored-procedures
    --Prashanth

  • How to rename a column name in a table? Thanks first!

    I tried to drop a column age from table student by writing the
    following in the sql plus environment as :
    SQL> alter table student drop column age ;
    but I found the following error
    ORA-00905: &#32570;&#23569;&#20851;&#38190;&#23383; (Lack of Key word)
    I have oracle enterprise edition 8.0.5 installed at windows 2000
    thank you
    And I want to know how to rename a column name in a table?
    thanks

    In Oracle 8i, your syntax would have worked.  However, if I
    recall correctly, in Oracle 8.0, you can't rename or drop a
    column directly.  One way to get around that problem is to
    create another table based on a select statement from your
    original table, providing the new column name as an alias if you
    want to change the column name, or omitting that column from the
    select statement if you just want to drop it.  Then drop the
    original table.  Then re-create the original table based on a
    select statement from the other table.  Then you can drop the
    other table.  Here is an example:
    CREATE TABLE temporary_table_name
    AS
    SELECT age AS new_column_name,
           other_columns
    FROM   student
    DROP TABLE student
    CREATE TABLE student
    AS
    SELECT *
    FROM   temporary_table_name
    DROP TABLE temporary_table_name
    Something that you need to consider before doing this is
    dependencies.  You need to make a list of all your dependecies
    before you do this, so that you can re-create them afterwards. 
    If there are a lot of them, it might be worthwhile to do
    something else, like creating a view with an alias for the
    column or just providing an alias in a select.  It depends on
    what you need the different column name for.

  • Error 7 occurred at ABAPI Dist Report Read Link Info Error.vi - [.....] - RTBUIP_Build_Invoke.vi.ProxyCaller

    Hi all,
    I am on a field campaign with my Labview-controlled instrument. I wanted to make a small change to the code and build it again for uploading to a cFP-2020 Fieldpoint but the application builder stopped with the following error message:
    Error 7 occurred at ABAPI Dist Report Read Link Info Error.vi -> ABAPI Dist Cmp Settings to Disk Hier.vi -> ABAPI Get Settings From File2.vi -> ABAPI Get Settings From File.vi -> RTBEP_Invoke_Build_Engine.vi -> RTBUIP_Build_Invoke.vi -> RTBUIP_Build_Invoke.vi.ProxyCaller
    This is another computer than the one I used in the lab previously so might have forgotten to install something. I just copied the whole application folder with project file and subfolders
    to the Laptop I am using now. Labview version should be the same though (8.20).
    Any suggestions?
    Olaf

    Hello Olaf,
    This error is usually found when a subVI or a support file (DLL, custom control, etc)
    isn't able to be found by the application builder.  Possible reasons
    for this could include subVIs no longer located in their original
    paths and in need to be relinked, a DLL that isn't included in the build,
    and many other possibilities.
    You wrote that you copied the project from another PC, so it is very possible that some file went missing. Are all VIs in your project executable?
    You could try to mass compile all the VIs in your project and see if that helps.
    Regards,
    Johannes
    AE, NI Germany

Maybe you are looking for