Replacement of specific links to script

Our company is the subject of a change in name/logo and we have around indesign documents of 1000-1500, who need to have the logo replaced/re-related links.

I need help creating a script, javascript, which will allow me to recreate a link to about 10 files of different logos to completely different paths with different file names using preferably.   All files located on a windows-based server, and are all our users indesign cs5.0 windows based as well.  I would like the script to loop through a set of links specific logo it will replace any and all instances of former logos with new logos.

Example of

K:\poor\directory\structure\sadface\RedCoLogo_White.EPS becomes L:\CompanyLogos\BlueIncLogo_W.eps

K:\poor\directory\structure\sadface\RedCoLogo_Black.EPS becomes L:\CompanyLogos\BlueIncLogo_B.eps

K:\poor\directory\structure\sadface\RedCoLogo_Red.EPS becomes L:\CompanyLogos\BlueIncLogo_R.eps

K:\poor\directory\structure\sadface\RedCoLogo_Green.EPS becomes L:\CompanyLogos\BlueIncLogo_G.eps

I've tried some premade scripts that use dialogs at the entrance of the old and new path, but I need the script runs without user intervention, so it can batch run by using another script that I found which will open the indesign files in a given directory, run a script, save and close.

I do not know very well of javascript, but I'm fimiliar with its functioning and its syntax/etc; I've already customized a handful of FindChangeByList scripts to use different txt files and active loop through a number of indesign files.

Any help would be greatly appreciated.

Hello

I added the adjustment options...

#target InDesign

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT
app.activate();

var myFolder = 'L:/CompanyLogos/';
var toSearch = ['RedCoLogo_White.eps', 'RedCoLogo_Black.eps', 'RedCoLogo_Red.eps', 'RedCoLogo_Green.eps'];
var toRelink = ['BlueIncLogo_W.eps', 'BlueIncLogo_B.eps', 'BlueIncLogo_R.eps', 'BlueIncLogo_G.eps'];

var inddFiles = Folder.selectDialog ('Please choose folder with *.indd-files').getFiles('*.indd');
var l = inddFiles.length;

 if (l === 0){displayDialog('The selcted folder doesn\'t contain ID-Files'); exit()};

while(l--){
    try{
app.open(inddFiles[l]);
var theDoc = app.activeDocument;

var allLinkNames =theDoc.links.everyItem().name;

for(var i = 0; i < toSearch.length; i++)
{
var myName = toSearch[i];
for(var s = 0; s < allLinkNames.length; s++)
{
var linkName = allLinkNames[s];
if    (linkName === myName){
var newFile = File(myFolder + toRelink[i]);

with(theDoc.links[s]){
    relink(newFile);
parent.fit(FitOptions.fillProportionally);
parent.fit(FitOptions.centerContent);
}

        }
    }
        }

        theDoc.save();
theDoc.close();

}catch (e){
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    displayDialog(e);
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    }
}

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

function displayDialog(aString){
var infoWindow = new Window("palette");
infoWindow.add("statictext", undefined, aString);
infoWindow.show();
$.sleep(2000);
infoWindow.close();
}

Hope this will work

Tags: InDesign

Similar Questions

  • Search &amp; replace to specific pages

    Is it possible to use find & replace to specific pages or a range of pages?

    I need to replace the number 2012 in 2013, but not throughout the document, only starting to say 150 to 350 page.

    any ideas? grep?

    I work with Indesign CS5

    Two things: you can connect both ends in the text flow when you move the pages back, and for the scriptiung challenged as you and I, we have the script forum where we can ask you for help: http://forums.adobe.com/community/indesign/indesign_scripting

  • How you can run a report on the distribution of click on the specific links on an email?

    We would like to see the breakdown on the clicks on the different specific links on an e-mail. I am aware that we can get this report looking at clicks on email and on specific traffic on the landing pages, Web site and/or document downloads, but I was wondering if there is a report in Eloqua showing the distribution of click on the links on an email?

    Thank you!!!

    Hi Melissa,

    I think breaking click link by E-mail might be what you are looking for.

    You can find it in the folder of electronic mail analysis reports.

  • Script to automatically replace the specific layers?

    Hello. I work for a small company and we frequently get client files I need to edit. Because of the way thay are formatted the layers always come with the same name/structure, but they still have a layer we need to replace. Go to a shared drive and manually place our desired element (a .pdf file if it is of importance) in the subset to continue with the file layer. Thus, for example, there will be a layer in the default file named layer 1, and this layer is Group 1 > Group > mask of clipping and Image.

    I know ideally we should simply fix the script that formats the layers, but for now is not possible. So what I would like to be able to do (assuming that it is still possible), is to have a script that we can run that automatically replaces the 'Image' file in these layers of subset, I spoke with a file to a location on a local computer (for example replace the 1 layer > Group 1 > Group > image.jpg with C:/example/example.pdf).

    I searched online and could not find anything, so I thought that I have turned to the community for help. Entries, suggestions or creative solutions would be greatly appreciated! And as always, thanks, everyone on these forums is usually very beautiful and impressive, so it's always nice to come here to help.

    Glad to see that you have accepted the challenge.

    Well, this should help you get started. Keep in mind, it is written in VB.NET then you will need to translate it is that you want in Javascript. At least you will have a model to begin with. This is just a quick hack for you to start with - you may need to change the layer you want the new image appears on, if it's important. In addition, it is assumed that you started with a plot point (image.jpg) and whether you want the new image to be incorporated. You will see the code tweak as you wish.

    Var app As Illustrator.Application = CreateObject ("Illustrator.Application")

    Dim aDoc as long as I. Document = app. ActiveDocument

    For each item in aDoc.RasterItems

    If the element. Name = "image.jpg" Then

    order of the day. Selected = True

    Dim newPlacedItem As AI. PlacedItem = aDoc.PlacedItems.Add

    newPlacedItem.File = "YourNewFilePathHere.pdf".

    newPlacedItem.Embed)

    order of the day. Delete()

    End If

    Next

    I hope this helps.

    -TT

  • OSPF quick Convergence on specific links in a network.

    Hello

    I have a couple of question regarding the acceleration of the convergence of OSPF to help me understand it better.

    In this case, I would like to speed up the OSPF convergence failure occurred between two specific locations without causing problems for the other routers on the network.  These two sites are part of the area of the spine. The two communities have two connection point to point between them on two different routers at each end.

    R1---(Serv Provider1) - R3

    SiteA                                                             Site B

    ---(Serv fournisseur 2) - R4 R2

    All I see there are two main factors controlling the rapid convergence of OSPF.

    1. the breach of the detection time.

    2. propagation of error / time recalulation FPS.

    The first factor - failure detection time can be reduced by decreasing the OSPF Hello/dead or using BFD programmable intervals to detect the failure.  What is the best option?

    Of what I see if using timers in OSPF Hello/dead I should only match values of timer on router interfaces on part and on the other of my links point to point and could leave other interfaces as they are. Is this correct?

    Consider the second part - by strangling the timers of SPF, OSPF SPF computation time is reduced. New account my two links Point to what I can fix timers on the routers to share back and forth across the point-to-point link or I have to put the same on all routers in the OSPF network.

    ("Timers SPF throttle"command).

    Hi Pat,

    Regarding the SPF hold timers. to confirm is there any issue with having different values on different routers in the network. I presume not as the value is random anyway?

    the values to see the SPFA is always a compromise: on the one hand you don't want a permanent recalculation caused by a link heartbeat, on the other hand, expect a rapid convergence. It means finding values that meet the requirements in terms of stability and convergence at the same time.

    I think that the main problem with different values in a box is micro-boucles. Since the new calculation (and update routing tables) not be made never exactly at the same time on routers, link-state routing protocols can produce short times with micro-boucles once the topology changes because some transfer tables are updated as soon as the others (we are talking about tens-hundreds of milliseconds).

    If you change the FPS-timer to say that 1 second or even less and other routers in the region still have the default (which is 5 seconds), the period of time where are micro-boucles may occur could be considerably long and that there could be a side effect, according to the topology/design.

    Hope that helps

    Rolf

  • Is it possible to add layers of replacement in the form of script to CA? And the arms of mirror, as well.

    I would like to be able to replace the hands that I drag his arms around, so they move to different punches or pre-made hand positions on different layers. Would it not possible this feature of script?

    And I wish I could click a button to activate the mirror effect of the arms as one is being dragged and saved.

    That might work. Another character option: you can also associate different forms of hand with different keyboard triggers and trigger the correct forms of hand manually by pressing the keys of the trigger at the right time.

  • 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);

    };

    };

  • Find the angle of rotation of the anchored object, replace that specific object by letter

    I got indd file customer. General problem is that he described certain letters of the words.

    In fact, he described the letter e and that it rotates 180 °. It also makes with the letter c and there a rotation that anchored-178, 8250 ° oppose.

    Now, I tried to change this objects to the real letters. Problem is that I can't find the option for the rotation of an object in the Find/Replace dialog box, and also I can't fint in Grep. So, what are my options?

    Thanks in advance...

    PS. If there is a possibility to change one of them, I can change a second with finding anchored object and change it to specific letter...

    Looks like someone could not find the real schwa or o open on their keyboards

    Possible, but tricky.

    This Javascript will search history containing the text for items cursor which rotated 180 degrees and replace them with a question mark. Replace the question mark with the character really wanted in notation Unicode Javascript ("\u... ("-here character four-digit hexadecimal code).

    It really isn't a good way to check if it really is one that you should be replacing, so it does not blindly on all 180 degrees of rotation objects...

    (You can simply change the "180" to your another number to check the other characters).

    all_text = app.selection[0].parentStory;
    
    for (thingy=all_text.allPageItems.length-1; thingy>=0; thingy--)
    {
         alert (all_text.allPageItems[thingy].rotationAngle);
         if (all_text.allPageItems[thingy].rotationAngle == 180)
         {
              all_text.characters[all_text.allPageItems[thingy].parent.index].contents = "?";
         }
    }
    
  • Need a replacement to break links more

    I love. As always, this addon is disabled once again.
    What addons provide the same functionality, i.e. "to highlight multiple links and open them in tabs.

    Yes, I could do another search of 60 minutes and the analysis, but I already did 3 times before and I'm tired of it. Please give me a list I can look at.

    Firefox 26.0 on XP.

    Try the beta version linked in the description of the add-on.

  • How to make a web specific link to open in Firefox while explorer is my defalut

    Unfortunately, I need to explore to be my default at work.
    But I want to make shortcuts on my desktop to specific Web sites that will be open in firefox.
    (in crome, it is posiball by adding a shortcut to an application)

    To do this, you will need to make copies of Firefox desktop shortcut and add the URL to the target line after the path to the Firefox program. Leave a space before the URL.

    See also:

  • How to replace a specific color with transparent colors?

    I need to get the image of a control, but I want to change the background color of the control with a transparent color (like the handly image editor).

    I can't use the library IMAQ, so I would use the palette of the 2D image.

    I can read the pixel of data image by pixer, but... once the color replace is located, how to replace them with transparent?

    Thank you all

    It looks like you want the Mask.vi to 'create '. If this isn't the case, you can provide a code that indicates what type of situation, you do business with.

  • Cannot access a specific link

    Original title:

    I have a problem to go through this link

    It is a local link and unbrowsable.  What makes you think you need?  Port 8889 is not a usual port.  I'd be suspicious of it

  • In Vista, it is possible to find and replace a specific name that I used many files on the hard drive?

    My apologies if someone already asked this (I couldn't find the answer however). I used the name of a person to dozens of (mostly Word) documents that are kept in many different files on my hard drive. I know that I can dig each document separately and then use hidden word and replace the tool to change the name. But this will inevitably take time. Is it possible to do a through - computer find and replace so that I don't have to do this exercise once? Any help gratefully received. Thank you.

    Hello

    I suggest you go through the article and check if it helps.

    Searching in Windows Vista, part 1

    http://Windows.Microsoft.com/en-CA/Windows-Vista/searching-in-Windows-Vista-part-1-secrets-of-the-search-box

    Searching in Windows Vista, part 2

    http://Windows.Microsoft.com/en-CA/Windows-Vista/searching-in-Windows-Vista-part-2-Start-menu-and-control-panel-search-tips

    Searching in Windows Vista, part 3

    http://Windows.Microsoft.com/en-CA/Windows-Vista/searching-in-Windows-Vista-part-3-using-advanced-search-for-those-hard-to-find-files

    Improve Windows searches using the index: frequently asked questions

    http://Windows.Microsoft.com/en-CA/Windows-Vista/improve-Windows-searches-using-the-index-frequently-asked-questions

    Hope this helps and let us know if you need more assistance.

  • remove all links is not finding all the links in my document, it works only on specific links?

    I use acrobat pro 10 and remove it all links work is not finding all the links when the document is clearly all links.

    Test thank you screen name!

    I think that I figured it out, I unchecked create hyperlinks from URLS in the preferences.

  • Change the color of specific links

    On a web page, I want to change the color of the links. I found other issues in the Council on this subject, but when I try to their answers, it will not work for me. Can someone tell me how to make these links on white blue background? I have CS5 DW. Here is the page:

    http://www.gaditesmaritime.com/links2.html

    Give thecell link/s is / are in a 'class' (see below), then wrap your link in an anchor tag to actually make a link (see below)

    http://www.bahamasmaritime.com"> www.bahamasmaritime.com".

    Then add your css styles below:

    .blueLinks a {}

    text-decoration: none;

    color: #069;

    }

    .blueLinks a: hover {}

    color: #099;

    }

Maybe you are looking for