Batch file reduction and batch save issues

I have a multi leveled directory of hundreds of ai images (black and white) which take up a few gbs on disk. To reduce size illustrator (lossless) has two useful features: delete unused panels action and save without embedded ICC profile which reduces the file size by around 90%.
Thus I want either script or batch action to iterate through my whole multileveled diecctory and perform the two key operations on each file whilst overwriting the original that was opened.
I'm no good with scripting so I've looked at the batch action. Delete unused panels is already within illustrator (cs4) so it's just getting an action that will save without the icc profile and overwrite in the same directory that the relevant file was opened in.
I've tried every recording to try and get this done but every single recorded save action leaves the save element as 'Save as'. I've tried messing with all the batch operation options and no matter what I do, the batch action removes the icc profile and the unused layers but saves every single file in the root directory and leaves the original in the directory structure.
I've looked through other posts and tried to record a 'save' action rather than a 'save as' and tried such things as 2 x 'Ctrl Y' to allow you to simply save rather than save as but nothing does the trick. Any help would be appreciated....

I have a multi leveled directory of hundreds of ai images (black and white) which take up a few gbs on disk. To reduce size illustrator (lossless) has two useful features: delete unused panels action and save without embedded ICC profile which reduces the file size by around 90%.
Thus I want either script or batch action to iterate through my whole multileveled diecctory and perform the two key operations on each file whilst overwriting the original that was opened.
I'm no good with scripting so I've looked at the batch action. Delete unused panels is already within illustrator (cs4) so it's just getting an action that will save without the icc profile and overwrite in the same directory that the relevant file was opened in.
I've tried every recording to try and get this done but every single recorded save action leaves the save element as 'Save as'. I've tried messing with all the batch operation options and no matter what I do, the batch action removes the icc profile and the unused layers but saves every single file in the root directory and leaves the original in the directory structure.
I've looked through other posts and tried to record a 'save' action rather than a 'save as' and tried such things as 2 x 'Ctrl Y' to allow you to simply save rather than save as but nothing does the trick. Any help would be appreciated....

Similar Messages

  • Difference between batch input method and batch input recording in LSMW?

    hi,
    plz tell me the difference between batch input method and batch input recording in LSMW?
    thanks & regards
    Ruban

    Hi Ruban,
               The main difference between the two is in lsmw we can view the code status at any time just by coming to prvious steps, but whereas in batch input method unless the recording is finished we cant view the code.
    second diff is tht we need to do lot of coding in batch inptu whereas here in lsmw we need not do much coding and mapping to data.
    third diff is that batch input is both inbound and outbound where as lsmw is only inbound.
    hope u got the differences.....
    Regards,
    sana M...

  • Batch File Search and Replace a String

    I've written a batch file to handle the copying of files.  I'm trying to reduce the number of parameters that I pass to the batch file.
    I want the batch file to perform a string replace on the directory path that is passed as a parameter to the batch file.
    Here is how I run the batch file:
    COPY_FILE.BAT C:\DATA\FTP_DATA\ACME\IN      (I'm passing directory path "C:\DATA\FTP_DATA\ACME\IN" as parameter %1)
    So my batch file will copy a file to the directory path represented by parameter %1.
    But then I want the file copied to a second directory.  I want the batch file to replace string "FTP_DATA" in the directory path with string "FTP_DATA\ARCHIVE"
    I know I could pass this path as a second parameter, but I want to limit the number of parameters so figured I could have the batch file perform a search and replace on string "FTP_DATA".
    After searching the internet, I thought I found the answer by using the following command in the batch file:
    set ARCHIVE_PATH=%1:FTP_DATA=FTP_DATA\ARCHIVE
    But it doesn't perform a search and replace.  It just appends to the directory path with the following result:
    C:\DATA\FTP_DATA\ACME\IN:FTP_DATA=FTP_DATA\ARCHIVE
    What I want is the this:
    C:\DATA\FTP_DATA\ARCHIVE\ACME\IN
    Any suggestions?

    Your syntax is not correct. Example:
    @echo off
    setlocal enableextensions
    set ARCHIVE_PATH=C:\DATA\FTP_DATA\ACME\IN
    echo %ARCHIVE_PATH%
    set ARCHIVE_PATH=%ARCHIVE_PATH:FTP_DATA=FTP_DATA\ARCHIVE%
    echo %ARCHIVE_PATH%
    endlocal
    -- Bill Stewart [Bill_Stewart]

  • Batch file reduction

    I need to batch process 500 jpegs at a time, reducing them to a consistant file size and dimension.  The originals are all between 4 and 7 megs, depending on the camera I use and my photo editor wants them all 8X10 or 12, 300dpi, 1-2 megs each.  Can some one tell me if this possible and if so how?
    Thanks  Chris

    Chris -- I think your photo editor needs to provide better specs.
    The only width and height sizes images have until they are printed are pixels.  How many inches high and wide is an image on a computer screen?  You can, of course, measure the image on a number of screens, but the result is meaningless -- it varies based on the hardware and software used to measure it.  Digital images are sized in pixels.
    That is why in Aperture you crop to an aspect ratio, not "inches" or "centimeters".  Your editor wants your images cropped to a "4x5" or "2x3" aspect ratio.
    You can Stamp a crop Adjustment in Aperture (Stamping as many images as you want), but that will apply the exact same crop to all the images.  Cutting out a section of an image with no regard to the image is unlikely to produce successful results.
    "DPI" is dots per inch.  This is a printer specification.  It is often confused with PPI, or pixels per inch.  My guess is that your editor means to say "pixels per inch".  It is generally accepted that one can make very sharp prints as long as the image is printed at 300 ppi.  To make a print 8" x 10" at 300 ppi you will need an image with 2,400 x 3,000 pixels.
    That covers the height and width.  The size of your file does not directly depend on the number of pixels.  It depends on the number of bits per pixel, and the compression applied in making the image file.  (JPG is an image compression standard developed for moving images around the Web.)  You specify the degree of compression in a JPG file when you create it (in Aperture, you specify the file type and other parameters when you export an image).
    When you export from Aperture you can specify DPI.  This is just a number stuck in with the image.  It has no bearing at all on the exported image's pixel height, pixel width, or size.  (You can easily verify this: export twice, once at 72 dpi, and once at 2,000 dpi.)
    If you have lower and upper limits of file size (e.g.: 1 MB and 2 MB), you will have to export your images and then see what size they are.  There is no tool in Aperture that varies the export parameters to match an arbitrary file size.
    HTH.
    Cheers.
    Message was edited by: Kirby Krieger

  • Script to create directory based on current file name and then save the file in that directory

    Hi all,
    I have a need save all my projects in a directory using the name of the main image I am working on.
    Manually these are the steps I used:
    Save As.
    Copy ( press command-c <== the filename is highlighted by default so all I have to do is )
    New Folder ( press the new folder button. Brings up a dialog box)
    Paste ( press command-v. <== Pastes the file name into the "New Folder" dialog box.)
    Save ( press thre save button. Saves the files into the new folder )
    Save As.
    Change format to JPG
    Save
    Change image quality to 12
    I want to assign these actions to a key
    Recording these steps and playing them back does not give me the results I need, snce the original name is hard-coded in the actionlist that was recorded
    What should I be doing instead ?
    Thanks in advance !

    You don’t mention which format the original file is (and figuring that and its current settings out seems too much of a hassle to me) so this would only save the jpgs into the folder (and create one if it does not exist).
    If you want to give it a try, paste the following text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit CS4 or /Applications/Utilities/Adobe Utilities-CS5/ExtendScript Toolkit CS5) and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.
    After restarting Photoshop the Script should be available under File > Scripts and can be assigned a Keyboard Shortcut directly, recorded into an Action, (in CS4 and CS5) be used in a Configurator-Panel or started from ExtendScript Toolkit directly.
    // saves jpg into folder of file’s name next to file;
    // be advised: this  overwrites existing jpgs of the same name without prompting;
    // thanks to xbytor;
    // 2012, use it at your own risk;
    #target photoshop;
    if (app.documents.length > 0) {
    var thedoc = app.activeDocument;
    // getting the name and location;
    var docName = thedoc.name;
    if (docName.indexOf(".") != -1) {var basename = docName.match(/(.*)\.[^\.]+$/)[1]}
    else {var basename = docName};
    // getting the location, if unsaved save to desktop;
    try {var docPath = thedoc.path}
    catch (e) {var docPath = "~/Desktop"};
    // create folder if it does not exist;
    var folderString = docPath+"/"+basename;
    if (Folder(folderString).exists == false) {new Folder(folderString).create()};
    // jpg options;
    var jpegOptions = new JPEGSaveOptions();
    jpegOptions.quality = 12;
    jpegOptions.embedColorProfile = true;
    jpegOptions.matte = MatteType.NONE;
    //save jpg as a copy:
    thedoc.saveAs((new File(folderString+"/"+basename+".jpg")),jpegOptions,true);

  • .doc file edit and re-save

    Hi.
    I need to read a word doc in jsp and replace <myName> with a String name = "Badleif" and re-save the file as a word document.
    Any idears.
    Badleif

    Either help this project: http://jakarta.apache.org/poi/index.html
    or use http://j-integra.intrinsyc.com/
    or change your fileformat to a more easily readable version.

  • Batch file settings and import of jpgs

    I have a batch of 20 or so images which when i import them all set to 5seconds as a default
    I want to import them and have them set to 10 seconds (to allow for transition times)
    can anyone advise the method please?
    thanks
    j

    Edit>Preferences>General.
    Change the Still Image Default Duration before importing the images.

  • Batch Color Correction and Batch Levels oddities...help!

    So I have an action that I've been using for the past couple years (?) now that involves opening an image, applying an auto color and auto levels, saving and closing. This has been working for me since probably a couple years ago when I made the action. Yesterday, I was working on a scanning project where I have groups of images in separate folders. I ran the action on the first 2 folders which went fine. When I got to the 3rd folder all the way up to the last one, PS just loads all the images, does the levels and color then fails to save/close them when done. On one of my folders, it gets through a few of them when it drops the ball and just opens all of them. I'm not sure what's going on as there's no real explanation as to why this is happening...especially when I've been using this action (and I even made a new action with still no luck). This is becoming a huge headache. Any feedback/help would be greatly appreciated...especially when last week I had about 300 images I had to work with and PS decided to pull this move on me after doing the first 30 of them fine...which is when I first noticed this happening.
    To further add, I set my action to show everything step by step and it seems to happen with select images (in some cases, these select images are entirely what is in the folder). With the select images, it is not doing the actions entirely in order. Typically it does it in this manner:
    1-Levels
    2-Levels
    3-Save
    4-Close
    What I'm now experiencing is this:
    2-Levels
    1-Levels
    (Skips 3 and 4 since it is starting at 2 and working upward). Hopefully you understand what I'm talking about!

    They're all JPEG, all coming from the same source (Images coming off of a Kodak PS410 scanner). I've also checked to see if they're 'read only' but they aren't. Odd thing is, I've taken this same set of photos to another computer and ran the same action and everything ran fine. As far as memory goes, I don't think that should be an issue as I'm set up with 16gb of RAM. And as far as what I was recently working on, these folders had probably 40 images max in them.
    I'll be running another batch on another set of images (coming from a different source) today and see what happens, if anything.

  • Huge file size and long save time in Premiere Elements 10

    I have just got Premiere Elements 10.
    I have a 80MB webinar recording in wmv format which I'm using PE10 to remove sections and resave. No fancy filters or effects. Just cutting out unwanted bits. My issue is that no matter what save formats I look to set, my 60 minute cut down video is estimated at almost 6GB. It has also been rendering and saving for the past 3 hours and only at 41%. How in the world can the shorter video be 75 times larger than the original!!!!
    I've used a lot of Adobe products in the past so I can't believe this software would actually be designed to be this way. I had previously used other software such as Windows Movie Maker and the file and save times were much smaller/shorter.
    My laptop has 4GB of RAM and an Intel Core Duo 2.66GHz processor so that can't be it. Also my Photoshop, InDesign, Illustrator etc all run fine.
    Any advise please? I must be missing something. PE10 couldn't be this useless.

    AltusDyna wrote:
    On the settings I was trying to pick ones that looked small
    That'll be your problem.
    It sounds as though you have tried to select project settings that match your anticipated output. That is completely wrong for PRE (although it is the case in some competitor products. In PRE you must pick a project setting that exactly matches your clips. You can identify the clips with something like GSpot or MediaInfo.
    You will also know if you picked the right setting when you add a clip to the TimeLine. If a red line appears across the top of the TimeLine you have picked the wrong setting.
    Analyze your clip with GSpot and post a screenshot here. Then we can tell you what setting to use.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children

  • Has anyone made a script to batch import 2d and batch convert and batch export using the 3D repoussé to an .obj?

    Im looking to batch import around 4000 images and convert them into 3d objects, but I'm not sure how i would script that to work in Photoshop. Do you think photoshop can handle that many operations?

    try below code
    before run script close all indb file
    var fileFilters = "InDesign:*.indb*";
    var myFolder = Folder.selectDialog ("choose Folder", fileFilters, false);
    var files = myFolder.getFiles("*.indb");
    for(i = 0; i < files.length; i++)
           var theDocument = app.open(File(files[i]), true);
             with ( theDocument ) {
                alert ( theDocument.name)
                 exportPdf(theDocument)
    function exportPdf(theDocument)
          myFilePath = myFolder + "/" +  theDocument.name + "_" + ".pdf";
            myFile = new File(myFilePath);
              theDocument.exportFile(ExportFormat.pdfType, myFile, false, app.pdfExportPresets.item('[Smallest File Size]'));
    theDocument.close(SaveOptions.no)

  • Saving documents via Scripts: Get current file name and set save path/file type

    I am writing a script that will:
    -Make all layers invisible
    -Make a layer named "background" visible
    -Delete all the invisible layers
    -Save the docment as an EPS file (leaving the original document untouched)
    I am new to scripts and so have based my script by copying code from other scripts.
    Here is my code:
    var doc = app.activeDocument;
    var name = doc.name;
    var hide = function (){ // hide all layers (based on http://forums.adobe.com/thread/644267)
         var L=doc.layers.length;
         for (j=0;j<L;j++){  doc.layers[j].visible=false; }
    hide();
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++) {
                  // Create the illusrtratorSaveOptions object to set the AI options
        var saveOpts = new IllustratorSaveOptions();
        // Setting IllustratorSaveOptions properties.
        saveOpts.embedLinkedFiles = true;
        saveOpts.fontSubsetThreshold = 0.0
        saveOpts.pdfCompatible = true
    //Set up Variable to access layer name
              var currentLayer = app.activeDocument.layers[i];
    // Loop through the layers and make the back ground layer visible
              if (currentLayer.name == "Background") {
                        docName = name + currentLayer.name+".eps";
                        currentLayer.visible = true;
    // Delete Invisible Layers (based on http://www.cartotalk.com/index.php?showtopic=7491)
    var myDoc=app.activeDocument;
    var layerCount=myDoc.layers.length;
    for (var ii = layerCount - 1; ii >= 0; ii--) {
        var currentLayer = myDoc.layers[ii];
        currentLayer.locked = false;
        var subCount = currentLayer.layers.length;
        for (var ss =subCount -1; ss >= 0; ss--){
            var subLayer = currentLayer.layers[ss];
            subLayer.locked = false;
            if (subLayer.visible == false){
                subLayer.visible = true;
                subLayer.remove();
        if (currentLayer.visible == false){
            currentLayer.visible = true;
            currentLayer.remove();
    // Save Out Document with New Name
    var saveName = new File ( doc.path + "/" + docName );
    doc.saveAs( saveName, saveOpts );
    Everything works fine except:
    1) It saves the document with the name AdobeIllustratorBackground as opposed to the name of the document
    Also, I am not sure how to tell the script to save as EPS and to specify the save location.
    Could some one give me some pointers?          Thanks!

    Thanks! I changed my code to this:
    var title = doc.name;
    var title = title.substring(0, title.length - 3);
    And it now works! (The substring thing removes the .ai extenion).
    However, how do I get it to save it as an EPS? (I found this script that  saves as PNG, but I am not sure how to adapt it to EPS).
    Also, how do I set the file output path?
    Thanks for any help that can be offered.

  • Safari-Netflix-and Screen Saver Issues

    Finally Safari will allow me to watch Netflix, however, my screen saver is set to 5 minutes, and Safari does not know I am watching a movie. Oh yea you say, just change the screen saver, well, i get tired of that, and remember I have to set it back the next day or have my screen constantly burn in, and besides, Mozilla does NOT have this problem. If Safari programers are reading this, know, Safari has been lacking and behind advancements by about 3 years since its introduction, please spend the money and time and get it ahead of the ball, get it competitive. Make Skype numbers dial-able in Safari, Make a separate Refresh button so we can place it next to the navigation buttons where it belongs, Make my screensaver know that I am watching Netflix, all this is NOW available in Mozilla, and I am having to go back there, till Safari can grow up and compete.

    Hi ellaine,
    Lets check your energy saver settings:
    About Energy Saver sleep and idle modes in Mac OS X
    http://support.apple.com/kb/HT2412
    Regarding your second question, it may be that your display is set to sleep before the screen saver starts. That would cause the screen saver to never display.
    Thanks,
    Matt M.

  • File constructor and unicode filename issue

    I have issues with unicode filename.
    I need to create a File object from unicode file name "&#1070;&#1075;&#1072;.mp3" in order to use it in the code.
    File in=new File("&#1070;&#1075;&#1072;.mp3")
    AudioFile f = AudioFileIO.read(in);
    Tag tag = f.getTag();
    Anybody knows how to deal with a file or directory that is named using Unicode characters?

    1) Have you tried just reading the file as a file using a FileInputStream?
    2) What operating system?
    3) What Java version?
    4) What are the \uxxxx values of some of the problem characters?
    Edit: I have just run        String filename =  System.getProperty("user.home") + "/\u1070\u1075\u1072.mp3";
           File file = new File(filename);
           OutputStream os = new FileOutputStream(file);
           os.write("Hello World".getBytes("utf-8"));
           os.close();
           DataInputStream dis = new DataInputStream(new FileInputStream(file));
           byte[] buffer = new byte[(int)file.length()];
           dis.readFully(buffer);
           dis.close();
           System.out.println(new String(buffer,"utf-8"));on Unbuntu 7.10 using JRE/JDK1.6.0_3
    without any problems other than not being able to see the \u1070\u1075\u1072 in my console because I don't have fonts installed for displaying them.
    Edited by: sabre150 on Dec 28, 2007 8:52 AM
    Further edit: It also runs on Windows XP using 1.6.0_03 .
    Edited by: sabre150 on Dec 28, 2007 9:00 AM
    I don't think the file is located where you think it is!
    Edited by: sabre150 on Dec 28, 2007 9:02 AM

  • Java and Batch File Issue - need urgent help

    I have a java program which calls a batch file. This batch file calls another java program. I want an option so that I can close this java program from main program.
    If i try process.destroy then it will call batch file and not java program.
    I can't go away with batch file.
    I will appreciate if someone can help me.

    khannap wrote:
    Hi, Thanks for the help but this doesn't seem solving my problem completely. I will appreciate if you can help more.
    I will explain you the scenario -
    1. There is java program provided as an external program to me.Only changes things slightly.
    2. This java program is called using batch file. When batch file is started this java program starts and listens on a socket for incoming data.I would want to wrap the launch of this java program in another JVM so we can use process.destroy().
    3. I am writing a program to check performance of the above java program. I want to call this java program from my program in a loop having some varying config data. When I run the loop first time I create a batch file at run time which executes the batch file provided by vendor. This batch file starts the socket. Once my message list is over then my loop goes to executing the batch file again with different config parameters. But this time I run into issue because my previous java program is not killed after message sending was over.Would it be acceptable to mung the 3rd party batch file to insert a wrapper JVM?
    Even if i use threads I don't think I can get rid of batch file.I did not suggest getting rid of batch files.
    So, I need to find a way so that when any iteration of loop is over then this socket program is killed. These 3rd party java programs - do they not have a "terminate" command you can put at the end of your message list?
    Even if i closed the socket from my client program that doesn't help because server is still listening and waiting for new client.
    I need to kill server which was started by batch file.On Linux it would be fairly simple to modify your batch file to determine what the process id is and send the process a signal to terminate it.
    Not sure what you can do on Windows.

  • Batch File to look at specific location in txt files

    Is there a way to have at batch file look at a specific line and location from a text file and pull it for use in the batch file?  For example, line 1 of sample.txt position ~15,8.
    I'm currently using the Find command(FIND /C "" *.TXT) but would like to be more specific in search.

    From a command line prompt, type 'help set' and look at environment variable expansion. Read the part that says "May also specify substrings for an expansion." It shows an example that uses ~10,5 to start at offset 10 and get the next 5 characters. Of course,
    this means that you will need to you will need to loop through each line. Use the FOR command; type 'help for' and start reading from "Some examples might help." It shows how you can parse a text file:
    FOR /F %%i IN (myfile.txt) do @echo %%i
    In a batch file, use two percent signs. At the command line, use one percent sign. 
    After the 'do' in the FOR command, you can use a CALL :Someprocedurename %%i, which would pass the line from the file into a sub and you can use the SET command to parse it.
    The Help mentions Command Extensions. At command prompt, type 'help setlocal' and read about ENABLEEXTENSIONS. At the bottom of the Help, they give you an example of how to add this to a batch file. You will need this to use the SET command to parse lines
    from the file.
    If you want to save the output, use the redirects, > or >> (create output file or append to output, respectively). Use the same for HELP output: help for > for-help.txt. In your line parser, you would do something more like this:
    [code]
    :ParseLine
    @echo %1 >> outputfile.txt
    exit /b
    GoTo :Eof
    [end code]
    To exit a sub, use either exit /b or goto :eof. Exit will allow you to return a value or error code. Goto :eof simply goes to end of file and returns control to the caller (in our case the FOR command). Of course, you can type 'help exit' to learn more.
    Outside of a subroutine, exit will end the batch file script and return to command prompt. This can be useful when you call this batch file from another script, but if you are starting it from Windows you may want to keep the command prompt open to show user
    the results or simply tell them to look at the output file.
    You can find good samples on Rob Van Der Woude's website.
    http://www.robvanderwoude.com/batchstart.php
    A major geek...

Maybe you are looking for