Rename a batch script and link images?

Hello, everyone!

First of all, I did search for this before asking and found many similar scripts for this, but as I don't know how to make or edit scripts, I could not use them...

I work in a company that produces school books. Each InDesign file that we can have hundreds of images of various extensions (.eps, .ai, .psd, .tif).

We must now rename these images to a naming system defect that we defined. It takes hours or even days to do it manually.

These images have currently changed names, so we would need to ignore what is there, just need us a prefix configurable (as "EF6_ESP_C1_"), then a number starting at 0001 4-digit and the rest of the numbering (if there are say a .tif and then a .ai, it should be 0001.tif and 0002.ai), then the extension that she already had.

Preferably, but not not mandatory, if one could read that the image already had a "EQ" in the name of the file, he could rename them to another prefix and counting those separately from 0001, while we work equation images separately, but if this is impossible or is too difficult to do, so just have named and numbered with others.
-What someone would be kind enough to help me with this? Thank you very much!

Try this,

var doc = app.activeDocument,
    links = doc.allGraphics, count = 1, eqcount = 1, a = "0000";
for(var i=links.length-1;i>=0;i--)
{
        if(links[i].itemLink.name.match(/^EQ.+/))
        {
                var ext = links[i].itemLink.name.substr(links[i].itemLink.name.lastIndexOf(".")),
                    old = File(links[i].itemLink.filePath),
                    eqnum = (eqcount++).toString(),
                    newname = "EQ_EF6_ESP_C1_" + a.substring(0, a.length - eqnum.length) + eqnum + ext;
                old.rename(newname);
                links[i].itemLink.relink(File(old.toString().replace(links[i].itemLink.name,newname)))
            }
        else
        {
                var ext = links[i].itemLink.name.substr(links[i].itemLink.name.lastIndexOf(".")),
                    old = File(links[i].itemLink.filePath),
                    num = (count++).toString(),
                    newname = "EF6_ESP_C1_" + a.substring(0, a.length - num.length) + num + ext
                old.rename(newname);
                links[i].itemLink.relink(File(old.toString().replace(links[i].itemLink.name,newname)))
            }
    }

Please note: it is not reversible.

Kind regards

Cognet

Tags: InDesign

Similar Questions

  • Script Batch convert all linked images?

    Does anyone know of a script that I can use to convert all my files related to JPEG? I have to give the ID file to the client with hundreds of related images and don't want to have to convert all the files PSD one (and link).

    Bonus: change all the names of the CUSTOMER files - NAME_001.jpg

    Thank you!!

    In my opinion, this can be done without the help of a script.

    You'll need a PhotoShop action and batch processing in PhotoShop to make the conversion from PSD files to jpg.

    Then in InDesign connect images PSD selected in the folder of links with the command bind again file Extensions that allows to choose the good suffix, jpg, be reprinted from the PSD with the same name, but a different suffix. (InDesign CS5 and above)

    Uwe

    EDIT

  • [ADF, JDev12.1.3] When you rename problems see criteria and link vars used in VO

    Hallo,

    1)

    I changed the name of a view VO criterion, but I'm not able to buld the project.

    Error: myapp.model.vo.MyVO: could not find the referenced object. Object =VC_OLD_NAME Owner = myapp.model.vo.MyVO

    But if I look everywhere in the application I'm not VC_OLD_NAME.

    How can I solve this problem?

    When you rename a VC, JDev auto updates all references to this VC in the application? Or I don't have to worry about it?

    2)

    I renamed a binding var defined for a VO where clause.

    JDev seems to auto update all references to this var binding, but the strange thing is that, in the original Version, the old name is still present (he doesn't).

    Why?

    3)

    Perhaps in the future I would better take not to rename this kind of objects?

    Thank you

    Federico

    1)

    JDev sometimes has problems with refactoring.

    Maybe you can try to close jdev and remove .data folder in your project.

    2)

    Because there is no exact reference to link var if you need to change this manually.

    3)

    Perhaps in the future the jdev will have less bugs

    Dario

  • How to delete a DATA FILE and rename the other DATA of FILE Batch scripts

    DELETE or DROP d:\NDM\Data\StampFiles\STAMPLOADBKUP.csv

    RANAME d:\NDM\Data\StampFiles\STAMPLOAD_cwoo.csv data file for d:\NDM\Data\StampFiles\STAMPLOADBKUP. CSV

    what works for use in support of scripting batch above and need exact syntax please. I am poor in the batch script.

    Concerning
    Soma

    ================
    D:

    CD d:\NDM\Data\StampFiles

    del STAMPLOADBKUP.csv

    Ren STAMPLOAD_cwoo.csv STAMPLOADBKUP. CSV

    ================

    That should do it for you!

  • How do you define subfolders in the images of Muse and link to the main image folder?

    Currently I have my site set up where I have two subfolders in my main site. So when I export everything that I need to go to the pages that I end up putting in subfolders and relink the code in the main folder to find his images. For example:

    Main folder:

    index.html

    Other.html

    Slot (in main folder) folder:

    index.html (this file is exported to the main folder and then I hang out in this folder and re-edit the code)

    I re - edit the code to make the page work again. "Code example: href =".. /.. /

    Not just href but image and script and so on.

    It's a lot of work because I have a lot of these courses. So whenever I export I have to open all of these files and re-edit each time. In this way is to risky for me as I hope that I do not miss it and download my site broke which gives a bad image for my website.

    Ideas, any help would be greatly appreciated! Thank you!

    Hi Rob,

    Sanjit response copies to your message on Facebook

    Unfortunately we are unable to define this structure of folder while exporters of Muse Muse will store the files exported to the destination-specific folder path. The only way is the manual way to link the pages to the main domain as you're already done this or create separate sites and upload them to the same field but with different folder destinations.

    If its on several areas, then 2015 Muse includes functionality to add several areas when downloading from the site to the server.

    Thank you

    Preran

  • Help with a script to remove the link "Place and link" content

    Hello

    I need a script that will separate the content that has been placed in an indesign document by using the feature "place and link.

    I know I can manually go to the link Panel, select the linked content here and click 'remove link' in the Panel menu. However, I have about 200 indesign documents that are all full of content that has been 'placed and connected '. One I get a script to unlink content, I can add it to a batch routine to make the record of 200.

    Can anyone help please.

    See you soon

    Like this?

    app.activeDocument.links.everyItem () .unlink ();

  • preloadNetThing and an image script dynamic php

    I have a php script that generates a gif image, based on a GET variable. for example which is called like this:
    ' http://whatever/bitmapPixel.php?color=00ff00'
    Now if it is downloaded and cached how I reference the filename of member property? When I use the url above as being the property of file name of members it errors when my script points to the Member. The Member is in the cast, but no file name is attached.
    I tried to use ' http://whatever/pixel.png' just to test if there is a problem with my script and it works fine.

    In similar circumstances, I managed to put the name of a member of bitmap file to a URL that generated an image on the fly through a PHP script. The secret was to start with a member of the bitmap that was already linked to an external file dummy. If I tried to put the name of a standard member file bitmap (not related), no picture has been imported.

    Is that what this fits your situation?

  • How to hide the user id and password in the batch scripts

    Hello

    Can help me hide the user id and the password in the batch scripts to automate the process of running script to export and action.

    Context: In my client project does not display user id and password that's why they are looking for guaranteed way to hide them.

    Thanks for your response in advance.

    Kind regards

    Sandra.

    Sandra,

    As stated by Craig Administrator's Guide is a good option.

    Let me give you a few steps I did in one of my projects.

    Open the command prompt and navigate to the location "C:\Oracle\Middleware\EPMSystem11R1\products\DataRelationshipManagement\client\batch-client"... here you can see many see as well other utilities.

    DRM-batch-customer - credentials.exe is the one that is used to encrypt the user name and password.

    Open this in the command prompt and choose the application that you want to encrypt the password.

    then remove the username and password from command script can run it... It does what you want

  • Moved the folder "Pictures" of Mac and catalog image files shows no images. Cannot navigate to the appropriate folder in 'Files' Panel and cannot rename the folder "Images". How can I reconnect catalog image files?

    Moved the folder "Pictures" of Mac and catalog image files shows no images. Cannot navigate to the appropriate folder in 'Files' Panel and cannot rename the folder "Images". How can I reconnect catalog image files?

    You opened an empty catalog.

    You can try the following two steps to open the appropriate catalog file.

    1. Use the file-> open recent, open the list of all catalogs
    2. If this does not work, you will need to find the appropriate help for your operating system catalog file and double-click it to open it.
  • Call the batch file and not the shell script using measures of the event

    Can I use EVENTACTIONS at the door of gold like

    eventactions (SHELL, /path-to-batch-file/test1.bat)

    will this work? I am on a windows machine, so I need to run a batch file and not a shell script

    In GGSCI, you can shell OUT to the BONE and call a command/executable file.

    For example on Windows:

    GGSCI (WIN2003) 2 > shell dir

    Volume in drive C has no label.

    Volume serial number is 8CCC-9E58

    Directory of C:\ggs

    18/08/2012 07:23

    .

    18/08/2012 07:23

    ...

    2010-10-15 06:37 bcpfmt.tpl 426

    2010-10-15 06:37 bcrypt.txt 1 725

    22/04/2011 03:41 2 560 category.dll

    05/11/2011 10:43

    cfg

    2010-10-15 07:15 739 chkpt_ora_create.sql

    ...

    What were the results when you tried this in an EVENTACTIONS clause?

  • Links in the JPG and GIF images.

    Hello Board,

    I do a few JPGs & GIFs animated for my site and my CMS allows the images to link to only a single link; for example, it

    connects the entire image.  Is it possible to incorporate multiple links in a single image, and THEN upload to a CMS?  If so, how?

    JPG and GIF image files may not contain even a single link. Links are only made by HTML.

    You can crop the image (see Photoshop help on "cutting") then apply unique to every links in the editor WYSIWYG CMS'.

    You can also manually enter an HTML image map for a single image file if your CMS allows raw HTML and does not filter this type of entry.

  • How to report the ip address resolved of nslookup as a variable in the batch script

    I have a batch script that performs a constant audit 'external server' living every minute and the activity is fed into a log file. The external server is on a dynamic ip address.

    for example,.

    Logfile = C:\Logfile.txt

    echo control myserver... > Logfile

    .

    .

    [see document test/myserver.domain.com]

    However, I would like to write in the log IP address that is being tested.

    That is to say

    the my_server checking to 123.456.78.9 echo

    Could someone tell how can I get the dns to resolve address from "myserver.domain.com' as a variable in order, can I use it

    for example,.

    RESOLVED_ADDRESS = (nslookup resolution results)

    the my_server % RESOLVED_ADDRESS % control echo

    Thank you

    Hi Jimimaseye,

    I suggest that you post the application on Microsoft TechNet forum because we have experts working on these issues. You can check the link to post the same query on TechNet:

    http://social.technet.Microsoft.com/forums/Windows/en-us/home?category=w7itpro

    Please do not hesitate to contact us if you have other questions related to Windows.

  • Difference in size of the Parent unit and linked clone

    Hi team,

    I do view Vsphere 5.2 implementation Horizon. Implementation goes smoothly, but I saw a c disk space difference of Parent and Linked clone.

    Windows 7 with Service pack 1 built with optimization script to disable unwanted services. Free space on the drive c image parent is 3.90 Go. When I put in service a clone related in this snapshot of parent picture I found free space in linked clone vdi is about 6.5 GB.

    Please specify if anyone face the same or it is normal in the linked clone.

    Thank you

    Ravindra.

    You use a disposable disc?    When you use a disk file page flies on this disc which may explain the difference in free space.

  • Can you have folders in you folder of images and the images are visible?

    Can you have records in your image folder and the images still be seen? I have a graphic file with images and they can be seen on the site, however if I insert files in the pictures folder, the images are not displayed, are what I did or is not possible with dreamweaver?

    I.e. graphic > pendants > outdoor shots.

    Inside or the other of the two last records images do not appear on my site!

    Images can be shown no matter where they are in your site. The only downside is that you have a working image link.

    For example, Graphic/Pendants/Exteriors_Shots/myImage.png note underscore in the path. This is because many browsers interpret too much space. This means that your subdirectory should be renamed accordingly.

  • Batch processing with an image overlay

    Is it possible to batch processing with an image overlay in FW CS4?

    I'm trying to resize several hundred images and place the corners rounded on them.

    If this cannot be done in FW, does anyone know of another program that could do this?

    Hi Marje,

    It is possible to include resizing and image overlay in a custom Fireworks command that can be used in batch mode.  For starters, you can check out this tutorial which deals with the first step.

    This article describes how to perform the resizing of the image and the overlay (in this case, a watermark) and then how to record the steps and turn in a custom control that can be used later in batch mode.

    Once you have registered the custom command, click on file > Batch process, follow the steps below:

    1. In the first window, select the images you want to process.
    2. On the next screen, open the drop-down menu commands , and select the custom command you created (it will probably be on the bottom of the list), and then click the Add button to include in the list of the batch process.
    3. Finally, on the next screen select the location of the processed files and possibly save the script of commands for later use.

    Good luck!

Maybe you are looking for