Script to rename the names of information link

I'm working on the conversion of a catalogue of old customers from Quark to Indesign.  I use Indesign CS4 on Windows Vista. I used Markzware Q2ID to convert indesign catalog with too many problems.  But I ran into a big problems with the images.  They will be automatically re-issued.  After digging around, I found the problem.  For some reason any all Image names also include the path structure.

For example

Link Info

Name: BDA - 12:Users:graeme:Desktop:FSIP back-up: _Collected:02405 PESA AftMkt EAST: photos: M587524. EPS

Path: BDA - 12:Users:graeme:Desktop:FSIP back-up: _Collected:02405 PESA AftMkt EAST: photos: M587524. EPS

Luckly that all names have the same problem.  So I hope find or write a script that can simply go through the indesign document and find/replace all the names link to remove "BDA - 12:Users:graeme:Desktop:FSIP back-up: _Collected:02405 PESA AftMkt EAST: photos:

I know it is a very simple problem, but it's my first real attempt to script something in Adobe.  Anyone have any good ideas or tips on how I could do this?

Thank you

VIC Bushfield

Victor,

The conversion program totally corrupt links in your document: myLink.filePath is just empty string, myLink.name, this is what should have been myLink.filePath (this is info from ESTK).

Here is a new version of the script - it rebuilt to the files located in the folder NewLinks on the desktop. Change this line

var myNewPath = '~/Desktop/NewLinks/' + MyName;

to the location of your links.

WARNING - I tested it on Mac, because do not have a copy of CS4 for Windows.

Kasyan

//----------------------------------------

indesign #target

If (app.documents.length == 0) {}
Err ("no document open. Please open a document and try again. ", true);
}

myDoc var = app.activeDocument;
myLinks var = myDoc.links;
var myCounter = 0;

If (myLinks.length == 0) {}
Err ("this document contains no links.", true);
}

for (i = myLinks.length - 1; I > = 0; i--) {}
myLink var = myLinks [i];
var myArr = myLink.name.split(":")
var myArr = myName [myArr.length - 1];
var myNewPath = '~/Desktop/NewLinks/' + MyName;
var myNewFile = new queue (myNewPath);
If {(myNewFile.exists)
myLink.relink (myNewFile);
myCounter ++;
}
}
   
If (myCounter == 1) {}
Alert ("a file has been relinked.", "Completed");
}
ElseIf (myCounter > 1) {}
alert (myCounter + "files were relinked.", "completed");
}
else {}
Alert ("Nothing has been relinked.", "completed");
}

function err (e, icon) {}
Alert (e, "Update path names Script", icon);
Exit();
}

Tags: InDesign

Similar Questions

  • Please share the Script to retrieve the name of host, HBA, HBAstatus, WWN, pathpolicy and dualpathinfo

    Please share the Script to retrieve the name of host, HBA, HBAstatus, WWN, pathpolicy and dualpathinfo

    Take a look on Re: information on the host hardware with information about the HBA drivers and nic

  • Script to change the name of the file to the virtual machine and its associated files

    Hello

    I'm looking for a script to change the name of the virtual machine in virtual center and also change it has associated file names in the data store to match file name of virtual machine. But the vmdk file will contain a descriptor which maps the - flat.vmdk file. So not sure that we can achieve this through a script.

    Thanks in advance!

    Not really as much as I know.

    The advantage of the svMotion is renamed it the files (.) VMX, VMDK,...) For you.

    The only alternative would be the command line. See Duncan Howto: renaming a virtual computer.

    With the help of the plink.exe tool which could possibly be scripted.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Cannot use fax function after rename the name of the printer

    I have an MFP HP LaserJet M1536DNF connected by network.  I have run the full setup package by the CD of the product, or on the web, complete update install the driver package.  The problem is the default printer name after installation as like "HP LaserJet 1530 MPF Series PCL 6" and can not be changed through the installation.  When I tried to change the printer name on the windows 'Printers and faxes', he managed but the fax doesn't work anymore after that.  It says probably 'impossible to find or connect the printer' after I click the fax or print the document to the fax printer.  However, I can still use the printing function after the name change.  The only way to solve now is to uninstall all and reinstall again, even I tried to rename back the name exactly for the name of the printer.  I use Window XP Pro SP3 with .net Framework 3.5 already up-to-date.  Thanks for the tips.

    Hi Cheetah12,

    Sorry to misunderstand.  I mean there is no option to not rename the printer when you run the complete package installation wizardfirst, but not the fax configuration wizard.

    In fact, I must mention once again that I have can print and scan even I renamed the printer.  Things I can't do the HP Send Fax or fax HP Setup Assistant and so, which means my fax machine was not working properly.

    Therefore, I follow the document from HP that you post step by step and of course the diagnosis by downloaded HP Print result and doctor Scan for both printing and scanning are in good health, all in green light!  But cannot always solve the problem of the fax.

    However, I finally found my way to solve the problem, which is just rename back the original printer name in the registry.  As a result, the printer in "Printers and faxes" which always shows the famous name, but actually running with the original name of the printer.

    In any case, thank you for your kindly help and fast track.  But I suggest there should be a direct way, like having an option to rename the name of the printer while the first installation wizard on your next updated version.  This will certainly help users who have to install 2 or more of the same model printer, to indicate which printer works easily.

  • Rename the name of Module e/s in M1000e

    Hi friends, is it possible to rename the name of Module e/s in M1000e? For example, in SLOT A1 in the name field displays the switch model and I would like to configure to display the name of switch´s.

    Concerning

    Hello

    There is not a way to rename the switches, only the server slots.

  • Rename the name of the file without updating the metadata

    Hello

    I'm new to LR and would like to know if it is possible to rename the name of the file in LR 5 (after the import of images) without changing the name of the original file in the EXIF metadata? For example, the name of the original file is DSC_1234.NEF and I would like to rename it to "Hawaii_1234.NEF" in the catalog, as well as the name of the file on the HARD disk, but woud like to keep the original "DSC_1234.NEF" in the metadata.

    It seems that LR also renames file name in metadata if I read earlier rename after import (through the library - option Rename pictures) will not change the name of 'original' file in the metadata.

    Thank you.

    André.

    Hmm - confusing...

    I mean, Lr going to keep "DSC_1234.NEF" as the piece of metadata named "Original file name", after you rename the file "Hawaii_1234.NEF". The 'current' file name, in the metadata, will of course be the new file name (Hawaii_1234.NEF).

    Did you want something different?

    Rob

  • Rename the name of the BPEL process

    Hello

    We are working on JDeveloper 11.1.1.5.0 and created a BPEL process in composite and wired it.

    Can someone tell me how to rename the name of the BPEL process which is given earlier.

    Sidonie

    It is a long process, but you can try this...
    https://blogs.Oracle.com/middleware/entry/renaming_bpel_process_names

  • Script to rename the virtual computer by name DNS listed in VC

    I am very new to powershell, and I tried to understand this by using pieces of code I found, but nothing helped.

    I'm looking for a script to take the given DNS host name for a virtual machine listed in VCenter and rename the virtual computer.

    For example.

    Host01VM01 (as shown in Vcenter) - the DNS name of the "something.xyz.com".   VM and rename it "something.xyz.com" in Vcenter.

    To run the script only for a group called "Mycluster" you can do:

    Get-Cluster "My Cluster" | Get-VM | `
    Where-Object { $_.Guest.HostName } | `
    ForEach-Object { Set-VM -VM $_ -Name $_.Guest.HostName -Confirm:$false }
    

    This script will only work for VMS that have installed VMware tools and probably only for VM which are turned on.

  • Rename the name of foreign key programmatically

    Hello

    I tried to rename a foreign key by program through this code of Rhino:

      var tables = model.getTableSet().toArray();
      for (var tidx = 0; tidx<tables.length;tidx++){
        var table = tables[tidx];
        var keys = table.getKeys();
        var keyCount = keys.length;
        for (var kidx = 0; kidx<keyCount;kidx++){
          var key = keys[kidx];
          if (key.isFK()) {
            var keyName = key.getName();
            if (keyName.endsWith("___FK")) {
              var keyNameLength = keyName.length();
              var newKeyName = keyName.substring(0,keyNameLength - 5) + "_FK";
              key.setName(newKeyName);
              table.setDirty(true);
            }
          }
        }
      }
    
    

    I was expecting to change the name of any foreign key when the name ends in '___FK' and simplify it to "_FK".

    It changes something, as you can see on this picture, but not all:

    rename_fk.jpg

    The green ellipse indicates the place where the replacement has been successful, the reds, the places where the old names of foreign key has not changed.

    I would like to know what to do in my script.

    Thank you in advance,

    Gábor Tóth

    Hello

    Try this one:

    var tables = model.getTableSet () .toArray ();

    for (var tidx = 0; tidx<>

    var table = tables [tidx];

    var keys = table.getFKAssociations ();

    var keyCount = keys.length;

    for (var kidx = 0; kidx<>

    var = key keys [kidx];

    keyName var = key.getName ();

    If (keyName.endsWith ("___FK")) {}

    var keyNameLength = keyName.length ();

    var newKeyName = keyName.substring (0, keyNameLength - 5) + "_FK";

    key.setName (newKeyName);

    table.setDirty (true);

    }

    }

    }

  • script to rename the layers in alphabetical order

    Hello world

    I have a name change script that works only on the numbers and I want to make it work for the letters too.

    What I want to achieve is to select a few layers-> load the script-> enter the desired name of the layer and brackets insert the letter of where to start. The script then iterates through the alphabet rename the layers and adding the letter from coresponding to the name and remove the brackets. For example, I select 4 layers, loading the script and when the guest comes on... Enter the name: test [C]. In the end, that I should have renamed layers testC testD, tests, testF

    Any help would be appreciated!

    Thank you

    So what you wanted, it is for renaming selected objects, no layers, right?

    Check this script, I took a different route, I added some comments, if you have problems with it, do not hesitate to ask

    // this script Renames selected Objects with a base name plus an incremental suffix
    // Carlos Canto // 07/03/2013;
    // http://forums.adobe.com/thread/1243774?tstart=0
    
    var doc = app.activeDocument;
    var sel = doc.selection;
    var rename = prompt("Enter the name and ONE character suffix (comma separated, no space):","test,A", "Increment Rename Selected Objects");
    if (rename!=null) {// quit if pressed Cancel
        var nameArray = rename.split(","); 
    
        var base = nameArray[0];
        var suffix = nameArray[1];
    
        var charCode = suffix.charCodeAt (); // convert the suffix character to Unicode
    
        if(sel.length>0){
            for(var z=0;z		   
  • Use scripts to change the name of the tab

    Hi all

    I'm trying to use scripts to add tabs to a tab control in an existing VI.  I am able to add new tabs easily enough, but I can't understand how to change the name of each tab when they are added.  Each name is extracted a TDMS file using a loop for.

    I looked through the existing discussion forums, and there are a few old messages that indicate I should look for the 'independent Label property', and that I should put it to allow me to change the caption of the tab.  There is always an explanation of this property in the help files, but I am unable to find my path to it in the current schema.

    Assuming that this property still exists in my version (2012), could someone tell me the correct sequence of references and property nodes to access this property?  Right now I use the class "TabControl".  If this property is obsolete, can someone let me know if there is a new method to achieve this?  Thank you.

    GSinMN

    After you have added the page, download the Pages property of the index of the newly added page, tab control, use the PageLabel of this page for the label.  It would be cool if the Add Page method returns the reference to the new page.

  • Rename the name of the connection Wireless in Windows 8

    In Windows 7, it was possible to change the name of the wireless connection to something meaningful (what a concept). For example my home wireless with ssid xxxxxxxx be named home wireless. When I connected to the Office Wireless (with a ssid of yyyyyyyy) he would be named Office Wireless.

    This seems to be is no longer possible in Windows 8. Microsoft is way too much fun playing silly blighters. They have really taken to a whole new level with this OS.

    After much research I found how to rename a wired connection, but not wireless. For the life of me I can't figure out how to do this.

    I'm * NOT * request your opinion on whether I should do this. I ask * HOW * to do this. (Futile attempt to ward off the unnecessary and inevitable "you shouldn't do" or answers "I don't see why you would want to...) »)

    Maybe what you are looking for requires you to access the registry to make the name change.

    HKLM\Software\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles

    Browse the list of profiles to find the one that you need, and then change the value of string ProfileName.

    You can also do this when you change wireless cards and to reconnect to the same network and the connection then presents itself as 'name 2 Wireless' or ' wireless 3 "instead of just"wireless name' name, you can delete old profiles of the same name, and then rename the current without the number on the end. "

    After changes simply refresh your list of network connections to view the changes.

    As always, changes in the register are not advised, so with caution, take a backup before you change etc etc.

  • How the name of a link in back/write.

    myDoc = app.activeDocument.links var

    function UpdateAllOutdatedLinks() {}

    for (var i = 0; i < myDoc.length; i ++) {}

    myLink var = myDoc [i];

    $write = myLink.file.name;

    }

    }

    UpdateAllOutdatedLinks)

    This is the "myLink.file.name" that gives me bad. Should what I use to write the name of the link. Ultimately I'll send them to a table and write this table to an xml file, but for now I just need to figure out how to get out the name. Thank you.

    What is confusing, is that you use myDoc to see the links, so that most of the people (I guess) would be expected to refer to a document. It is clearer to for example use myLinks to refer to the links in the document.

    Back to their names and links. Given a document and a link (for example a graph), then this line:

    app.activeDocument.links [0] .name

    Returns the name of the graph - just the name. This line:

    app.activeDocument.links [0] .filePath

    Returns the full path.

    I noticed at the time of your line "$write = myLink.file.name'." This is another problem because $write is not a function. To display something in the console of the ESTK, use

    $.writeln (myLink.name);

    Peter

  • Script to get the name of VMhost among a list of VM?

    Hi people,

    Can anyone here help me scripting by getting the ESXi host name or $vmhost name in the list of the VM?

    Thank you.

    You mean this

    Get-VM | Select Name,@{N="Host";E={$_.Host.Name}}
    
  • Script to change the name of the layer to fill model name Please HELP

    I have a guy here for emergency! I have more than 2000 model files in a library. These models are all labeled with the same names I want my layers to have. I'll make a new layer for each design for a total of 2000 layers. layers of 2000 is way more layers, then I want to name by hand, so if I can run a script to give the layers the same name as the model they are packed with it would help enormously.

    Help, please!

    Thank you

    I agree with Christoph, it would be easier to create all layers in IE:-

    #target photoshop
    main();
    function main(){
    var file = File.openDialog("Please select Pat file");
    if(file == null) return;
    if(!documents.length){
       var doc = app.documents.add(UnitValue(300, "px"), UnitValue(300, "px"),72,"Patterns");
    }
      file.open("r");
      file.encoding = 'BINARY';
      var str = file.read();
      file.close();
      var patterns=[];
      //Thanks to X for the regex
      var re = /(\x00\w|\x00\d)(\x00\-|\x00\w|\x00\s|\x00\d)+\x00\x00\$[-a-z\d]+/g;
      var parts = str.match(re);
      for (var i = 0; i < parts.length; i++) {
        var p = parts[i];
        var sp = p.replace(/\x00/g, '').split('$');
         patterns.push([[sp[0]], [sp[1]]]);
          }
      //load pattern file
      app.load(file);
    for(var a in patterns){
    fillPattern(patterns[a][0].toString(),patterns[a][1].toString(),100);
        }
    };
    function fillPattern(name, id, opacity) {
        activeDocument.artLayers.add();
        activeDocument.activeLayer.name = name;
        var desc6 = new ActionDescriptor();
        desc6.putEnumerated( charIDToTypeID('Usng'), charIDToTypeID('FlCn'), charIDToTypeID('Ptrn') );
            var desc7 = new ActionDescriptor();
            desc7.putString( charIDToTypeID('Nm  '), name );
            desc7.putString( charIDToTypeID('Idnt'), id);
        desc6.putObject( charIDToTypeID('Ptrn'), charIDToTypeID('Ptrn'), desc7 );
        desc6.putUnitDouble( charIDToTypeID('Opct'), charIDToTypeID('#Prc'), opacity );
        desc6.putEnumerated( charIDToTypeID('Md  '), charIDToTypeID('BlnM'), charIDToTypeID('Nrml') );
        try{
        executeAction( charIDToTypeID('Fl  '), desc6, DialogModes.NO );
        activeDocument.activeLayer.visible=false;
        }catch(e){app.activeDocument.activeLayer.remove();}
    };
    

Maybe you are looking for

  • ios10 - hide/show purchased music

    Since I updated to ios10 yesterday, my music list has been flooded with undownloaded purchases. How to hide these? I can't find the setting more. I checked General >..., iTunes and App Store >..., music >... Where is the setting to hide the purchases

  • the audio is still audible even after muting in multicam editing

    Hello I have a strange behavior: in a multicam editing, I cut the track, I pull down of the dB, I uncheck the audio but I can still hear the noise! It's really weird. When I go to edit/set his silence she is silent, but if I want that part muted, I c

  • How to install iOS 9.3

    How to download iSO.9.3 and install

  • emails are sent from my computer adverstising ' *' Associates RX.

    I have run virus scans scheduled AND just run a sweep of micro-soft. All scans show repairs and/or viruses.  How can I stop this. ?  should I close my msn account?

  • ASA5505 DMZ to access LAN

    Hi, I wonder if anyone has a quick solution to my problem here. We have several servers on the DMZ (192.168.2.0/24), but they cannot access all the resources inside, by default. We would like to open an inside (10.1.1.5) Syslog server to the servers