Change File Name on Save

Hi all,
I have an action recorded that helps me to resize and rename an original image several times.  The action works perfectly, but I have to have the save step as manual so I can enter the correct save name for each file after the action resizes the image.  The save process is idential each time so I figure you must be able to 100% automate this.  So here is the scenario - hope someone can help.
I have a heap of files open in Photoshop CS3
action - resize and save as (current action does this)
delete last 4 characters of current file name and add '1500' to end of current file name and save (this is what I want to automate)
action - resize and save as (current action does this)
delete last 4 characters of current file name and add '400' to end of current file name and save (this is what I want to automate)
action - resize and save as (current action does this)
delete last 3 characters of current file name and add '200' to end of current file name and save (this is what I want to automate)
action - resize and save as (current action does this)
delete last 4 characters of current file name and add '100' to end of current file name and save and close file (this is what I want to automate)
run action again for all open files (this is what I want to automate)
thanks in anticipation!   BD

Here's a script for you:
var count = 4;           // number of characters to remove
var appendStr = '1500';  // string to append
function main() {
  if (app.documents.length == 0) {
    return;
  var doc = app.activeDocument;
  var nm = doc.name;
  var base = nm;
  var ext = '';
  var m = nm.match(/(.*)(\.[^\.]+)/);
  if (m) {
    base = m[1];
    ext = m[2];
  if (base.length > count) {
    base = base.substring(0, base.length - count);
  var newName = base + appendStr + ext;
  doc.duplicate(newName);
main();
Save this to a file called "1500Dupe.jsx" or whatever.
At the end of your first action, call this script. It will create a duplicate of the current document with last 4 characters replaced with '1500'.
You will also need additional step in the action to save this to a file and close the duplicate document. It's simpler to do this in the action than it is in the script.
You will need to create new jsx files for each of the other substitutions that you want to make. Just change the 'count' and 'appendStr' values as needed and save to new files.
-X

Similar Messages

  • Change file name with oreilly servlet

    I am using oreilly servlet package and I want to change the file name to the file I am uploading, is this possible ?
    How ?
    Thanks.
    here I post the servlet code:
    package com.reducativa.sitio.servlets;
    * DemoParserUploadServlet.java
    * Example servlet to handle file uploads using MultipartParser for
    * decoding the incoming multipart/form-data stream
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import com.oreilly.servlet.multipart.*;
    public class DemoParserUploadServlet extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    response.setContentType("text/plain");
    out.println("Demo Parser Upload Servlet");
    File dir = new File("f:/");
    if (! dir.isDirectory()) {
    throw new ServletException("Supplied uploadDir " + "f:/ " +
    " is invalid");
    try {
    MultipartParser mp = new MultipartParser(request, 10*1024*1024); // 10MB
    Part part;
    while ((part = mp.readNextPart()) != null) {
    String name = part.getName();
    if (part.isParam()) {
    // it's a parameter part
    ParamPart paramPart = (ParamPart) part;
    String value = paramPart.getStringValue();
    out.println("param; name=" + name + ", value=" + value);
    else if (part.isFile()) {
    // it's a file part
    FilePart filePart = (FilePart) part;
    String fileName = filePart.getFileName();
    if (fileName != null) {
    // the part actually contained a file
    long size = filePart.writeTo(dir);
    out.println("file; name=" + name + "; filename=" + fileName +
    ", filePath=" + filePart.getFilePath() +
    ", content type=" + filePart.getContentType() +
    ", size=" + size);
    else {
    // the field did not contain a file
    out.println("file; name=" + name + "; EMPTY");
    out.flush();
    catch (IOException lEx) {
    this.getServletContext().log("error reading or saving file");
    }

    Hi there,
    I am facing the same problem that you have stated in your Feb 26, 2002 10:28 AM message regarding "change file name with oreilly servlet", I would like to change the file name to include a unique identifier upon upload, did you ever find a solution to your problem?
    Thanks!
    Todd
    [email protected]

  • Is it possible to change file name policy in the JRE cache folder?

    We are getting calls from our clients complaining of slowdowns in loading our Java applet. The reason is a virusscanner. If a virusscanner is in the middle, it can drastically slow down the download process, and therefore cause some high delay before the user can work on the our product as expected.
    On this csutomer's side, it may take up to 10 min (the first time it is ran) instead of 1 min. JRE 1.6 is in use.
    They dont want to exclude from antivirus scan all files from Sun\Java\Deployment\cache folder.
    Question:
    Is it possible to change file name policy in the JRE cache to make it less unique?
    Thanks,
    -Dima

    dgomel wrote:
    We are getting calls from our clients complaining of slowdowns in loading our Java applet. The reason is a virusscanner. If a virusscanner is in the middle, it can drastically slow down the download process, and therefore cause some high delay before the user can work on the our product as expected.
    On this csutomer's side, it may take up to 10 min (the first time it is ran) instead of 1 min. JRE 1.6 is in use.
    They dont want to exclude from antivirus scan all files from Sun\Java\Deployment\cache folder.
    Question:
    Is it possible to change file name policy in the JRE cache to make it less unique?
    I suggest you solve the real problem - big files.
    There are two scenarios
    1. Initial download
    2. Updates.
    The first takes as long as it takes. No way around it.
    The second means that you can't use one jar. Otherwise every single update requires downloading the entire application every time. Multiple jars means only the one that changed is downloaded.

  • How do I reconnect media after changing file name?

    The original file name is 1001.WAV I changed it to Take1 . How do I relocate the files? I use Pluraleyes to sync all my files.
    Cheers, Greg

    Change it back.  NEVER change file names in the Finder level if the media is in an FCP project.  Change it BEFORE you import it into FCP...or change the name IN FCP.  What you did was bad bad wrong wrong. Expecially since you already did things like sync it up with pluraleyes.
    Change it back.  Then change the name in FCP.

  • ADE changes file names

    The book I downloaded has each chapter as a seperate .pdf, each with it's own unique filename. ADE has retitled every chapter (.pdf) to the name of the book. Now that all the chapters have the same name, I can't transfer them to my Kobo. How do I change titles or get ADE to stop changing file names?
    Thanks

    Dimitri,
              As usual, thanks for the simple but informative explanation!
              Jason
              "Dimitri Rakitine" <[email protected]> wrote in message news:[email protected]..
              > I think your theory is correct - java classes cannot contain '-' in
              > the name and 45 is ascii decimal for '-'. 46 is '.'.
              >
              > Jason Rosenberg <[email protected]> wrote:
              > > I have been working with using jspc.
              >
              > > I have noticed in a few cases it changes file names.
              >
              > > For instance, when I compile the file: '6-12adrworld_090700.jsp',
              > > it produces: '_6_45_12adrworld_090700.class'
              >
              > > Where does the '_45_' come from? I am trying to work with the
              > > theory that '-' becomes '_45_'....
              >
              > > Also, in another case, I noticed a '_46_' was inserted.
              >
              > > Any ideas? Is this documented anywhere?
              >
              > > Jason
              >
              >
              >
              > --
              > Dimitri
              

  • Finder changes the file name in Save/Save As dialogue box

    Whenever I save or save as a file, the dialogue box opens, but when I make the file list active when using a mouse, the file name I click to changes the file name I am saving. I simply want to activate the file list window so I can find the right folder. For example if I am looking for a folder called "Receipts" I want to be able to click on the file list window to activate it and then type the first 2 letters of the folder-- "re" and then save the file in that folder. The finder keeps changing the name of the current file whenever I click on one of the "greyed-out" file names? This doesn't make sense unless of course I want to replace that file.
    Is there a shortcut that makes the file list window in the dialogue box active while in the SAVE/SAVE AS dialogue box??

    Yes, this example of horrible UI design has been a problem since "Panther". It illustrates what happens when you try to copy UI behaviour from another OS, do it poorly, and end up with a mess. In 10.3 and 10.4, the combination of the renaming behaviour with the default "replace" selection in the resulting save can result in data loss.
    Compared to the old Mac OS where a tab would flip the focus between the text field for the file name and the file browser, the current behaviour either doesn't allow enough keyboard access to controls, or with "full access" enabled, too many to cycle through easily. The inability to switch focus to the file browser using the mouse (depending on the view) is a horrible productivity loss. Having to recheck the filename before saving is a horrible productivity loss. Since there is no "undo" for the renaming in most files, having to retype the name is again, a horrible productivity loss.
    If they had done it right (a simple change, like requiring a modifier to rename), users would probably welcome the "rename" feature as a useful addition. Instead, it has the feel of something a junior Windows-trained programmer slipped in past their supervisor.
    In short, I am not aware of any workaround or hack to avoid this "renaming" behaviour. I doubt it will do any good since people have been doing so since "Panther", but you could try submitting feedback:
    http://www.apple.com/feedback/macosx.html

  • CS5 changes file name on command+save from photoshop to Lightroom

    Recently CS5 changes the names of my files to "untiteld" when I press "command + S" that have been exported from LR3. This doesn't happen to files opened directly from their original folder.
    I can save them to a different location using "command +shift+ S" and the original name stays intact.
    Any ideas on how I can fix this?
    Thanks
    Greg Eddinger

    No problem. Waiting for a video rendering and upload to finish ;-)
    If it is fixed in another account than it is highly likely that a develop preset or default gets applied to your images. This happens quite easily and has happened to me unknowingly too. Basically you would by accident have hit the Reset button in Develop while the option key was pressed. What you want to do is to go into Preferences->Presets and hit the button that says "Reset all default Develop settings". Then hit reset on your image. If none of that works, you can always trash the Lightroom preferences file. Quit out of Lightroom, go to the Finder. Hit command-Shift-G. Type ~/Library/Preferences/ in the display that you get to reveal the hidden by default preferences folder in your home account. Find the file that is called com.adobe.Lightroom5.plist (you might not see the plist extension on your computer) and drag that to the trash. Now start Lightroom again and your Lightroom should behave as if you just installed it. You might have to point it to your catalog file if it doesn't open with it there but with an empty catalog. File->Open Catalog-> select your main catalog.

  • How can I add form field value to the file name in save as dialog box

    I do not want the form to be saved automatically, just want the form to auto populate the "file name" only.
    A little background on the forms I want to use:  My company has 70 retail outlets, I'll use one of our pdf forms called an "Incident Report" as an example.  I would like for a store manager to be able to complete the form, then email the form to the main office (I already have javascript to add field values and form name to the email subject line), once the main office receives it, I want for them to be able to file the pdf electronically on our server.  We have mutliple forms that we use so I do not want any of the forms to automatically save anywhere, (at this time anyway) I just want the office personnel to be able to click "save as" (or whatever they will need to click) and the form automatically add certain field values from the pdf they have received, of which will be different each time the form is sent to the office (Date, store #, employee name etc.) in addition to the name of the form in the "File name" of the "Save As" dialog box.  The main office employees will decide into which server file the pdf should be saved.
    I'm using Acrobat 8 professional, the stores and office personnel use Adobe reader.
    One little note:  We currently print and file a lot of paper on a daily bases, as soon as I can get this to work, we are going green.
    Me and a lot of trees in this will really apprecitate any help you can give with this!  :-)

    You might want to take a look at the document "Developing Acrobat Applications Using JavaScript" (js_developer_guide.pdf) which is part of the Adobe Acrobat SDK, which can be downloaded here. Read the "Privileged versus non-privileged context" (p. 45ff.). You will find an example for "Executing privileged methods in a non-privileged context". Should be almost exactly what you are looking for.
    Small Outline: For security reasons ("the user always has to know what's going on") you are not allowed to use the "Doc.saveAs"-method without the user permission (--> in a non-privileged context). In order to reach the goal of a privileged context you can use a trusted function. You do this by creating a JavaScript file (*.js) in either the Application-JavaScript-Folder (default location on Windows systems: "%ProgramFiles%\Adobe\Acrobat 10.0\Acrobat\Javascripts") or the User-JavaScript-Folder (default location on Windows systems: "%AppData%\Adobe\Acrobat\10.0\JavaScripts"). Add the following content to the new file:
    myTrustedBrowseForDoc = app.trustedFunction( function ( oArgs ) {
         app.beginPriv();
              var myTrustedRetn = app.browseForDoc( oArgs );
         app.endPriv();
         return myTrustedRetn;
    myTrustedSaveAs = app.trustedFunction( function ( doc, oArgs ) {
         app.beginPriv();
              var myTrustedRetn = doc.saveAs( oArgs );
         app.endPriv();
         return myTrustedRetn;
    The developer guide actually wants you to add this content to the existing "config.js" file. I recommend creating a new file, since its easier to deploy in a network. Either way, every client/user who needs to be able to save documents this way, needs this JavaScript Code in his Application/User-JavaScript-Folder.
    Within the Acrobat Document, which you want to obtain a certain file name, you can now use the trusted functions "myTrustedBrowseForDoc" and "myTrustedSaveAs" to store the file. To call the trusted functions and deliver the file name you can either you use a form field (button) or you add a new menu item. Add the following JavaScript Action to the button/menu item and change "Roller Coaster" to the name of the field which contains the value which you want to become the new file name:
    var fileName = this.getField("Roller Coaster").valueAsString;
    try {
         var oRetn = myTrustedBrowseForDoc({bSave: true, cFilenameInit: fileName + ".pdf"});
         try {
              myTrustedSaveAs(this, { cPath: oRetn.cPath, cFS:oRetn.cFS });
         catch(e) {
              console.println("Save not allowed, perhaps readonly.");
    catch(e) {
    console.println("User cancelled Save As dialog box");
    Good Luck!

  • Excel 2010 missing default suggested file name in Save As dialog box

    I’m using Excel 2010 running on Windows 7 (32 bit).  When I open a certain file which produces the following message: "A file is in a different file format than its extension indicates", and then go to “Save As” (or “Save”) the
    file, the default suggested file name is missing (blank).  This didn't occur in previous versions of Excel. 
    In previous versions, Excel would automatically populate the original file name in to the File Name field.
      I have searched all over the net, looking for a way to change Excel so that it will once again populate the file name in this situation. 
    To reproduce:
    Create a new blank workbook
    save as type “Web Page”, (i.e. File name:  “Blank Example.html”)
    Close workbook
    In windows, rename file from .html to .xls  (i.e. rename “Blank Example.html” to “Blank Example.xls”)
    In Excel open renamed file (i.e. “Blank Example.xls”) and click “Yes” when prompted with the “A file is in a different file format than its extension indicates” message.
    Do a “Save As” and you will notice that the File Name is blank. In previous versions, this field would contain the current workbook file name
     (i.e. “Blank Example.xls”)
    Any help will be greatly appreciated.

    Hi Jaynet,
    In order to re-produce this, you need to answer "yes" to the rename file prompt and then continue with step 5 (above).
    The reason for this is not an exercise in futility - I assure you.  At my work and elsewhere, when web developers have created features to permit the end user to save web data in Excel format, often times the Excel files are saved locally in Excel's
    html format (but with the .xls
    extension). 
    (I actually prefer the .xls
    extension, because it is easier to just double-click the file to open in Excel, rather than to select the open-with and then select Excel. a file with the .html extension will default open in your default browser. Now, I could change my default program
    for the .html extension, but that would only solve a part of the problem and would not really address the bigger issue and that being that Microsoft changed a behavior in Excel and may not even be aware that it was a much used feature. )
    To continue, when I go to open the resulting Excel file, I am prompted with the message that the file type does not match the extension (which is fine and not bothersome to me).  It's at this point when I go to save the file that I get really annoyed.
    In previous versions of Excel, the default file name would be pre-filled with the current name of the file and the default file type would state that it is a Web html file.  I would just change the file type to Excel Workbook and hit enter to save.
    I would be prompted with "Are you sure you want to overwrite your existing file?" message and I would click "yes" and that would be that.
    However, in Excel 2010, because the default file name is blank, I then need to re-type the name into the field to save the file. 
    Any help is greatly appreciated.
    Thanks

  • Nowhere to type file name in save as dialog, is this normal . . .

    Hello;
    here's the problem;
    I'm having some problems with my main worksation and I'm going to probably rebuild it from scratch
    (HDD problem & an AVG Baked registry & network stack)
    so I've started by installing AA 2.0 (Full) onto one of  my backup systems
    & will follow with AA3.0 (Upgrade) if I can verify that the system can do the job for me
    here's the problem;
    I installed AA2.0 which is needed to get AA3.0(upgrade) to install
    but I haven't activated or registered yet because I don't want to waste any activations
    if I can't use the system
    is it normal for the save as dialog to not have a place to type a file name when AA isn't activated?
    System:
    HP/Compaq DC7600
    P4HT enabled 3.2GHz
    2GB DDR2 533MHz RAM
    Lots of HDD Space on 5 HDDs
    sidebar:
    why is my insertion point moved all over the page while I type this in firefox?

    thanks for the reply:
    don't know if this some sort of a display redraw issue:
    but if I just hit enter I get the file saved as untitled.wav (which is floating in the middle of the screen not in the correct location)
    and the file ends up in "My Music Folder" (which I never use, but can't change folders either)
    -good grief I hate M$ for their My . . . crap folders
    the system is using similar Intel-GMA integrated graphics as my main workstation
    the only difference is processors and the chipset is one generation back
    my main workstation has 965ry and the backup has 945g

  • Change file format in save as dialog

    when i 'save as' in photoshop cs4 to change a psd to jpeg, the extension does not change.
    example: original file- 123.psd, save-as 123.jpeg. instead of adding .jpeg, cs4 adds the word 'copy' in the file name and keeps .psd. if i try to open the file again, ps says it is not a supported format and does this until i manually change the extension to jpg.
    any ideas?
    thanks
    im on a mac pro dual 2.66 running os 10.5.6

    Might You have set »Append File Extension« to »Never« in Preferences - File Handling by any Chance?

  • Dynamically populate pdf File name in 'Save As' dialogue box

    We have  rendered a pdf using adobe webservice.
    Once the pdf is generated , and we click on saveAs menu dialogue box opens and default name is populated in fileName field.
    Can it be possible to populate that name dynamically ? We tried using response.addheader() but it didnt work.
    Note : We are using java to create xml which we are passing to adobe webservice.

    Hi Jaynet,
    In order to re-produce this, you need to answer "yes" to the rename file prompt and then continue with step 5 (above).
    The reason for this is not an exercise in futility - I assure you.  At my work and elsewhere, when web developers have created features to permit the end user to save web data in Excel format, often times the Excel files are saved locally in Excel's
    html format (but with the .xls
    extension). 
    (I actually prefer the .xls
    extension, because it is easier to just double-click the file to open in Excel, rather than to select the open-with and then select Excel. a file with the .html extension will default open in your default browser. Now, I could change my default program
    for the .html extension, but that would only solve a part of the problem and would not really address the bigger issue and that being that Microsoft changed a behavior in Excel and may not even be aware that it was a much used feature. )
    To continue, when I go to open the resulting Excel file, I am prompted with the message that the file type does not match the extension (which is fine and not bothersome to me).  It's at this point when I go to save the file that I get really annoyed.
    In previous versions of Excel, the default file name would be pre-filled with the current name of the file and the default file type would state that it is a Web html file.  I would just change the file type to Excel Workbook and hit enter to save.
    I would be prompted with "Are you sure you want to overwrite your existing file?" message and I would click "yes" and that would be that.
    However, in Excel 2010, because the default file name is blank, I then need to re-type the name into the field to save the file. 
    Any help is greatly appreciated.
    Thanks

  • Changing file name and directory structure for use outside of iPhoto

    Hi,
    I was wondering if its possible to get iPhoto to name the files from my library to reflect the names that I've given the files in iPhoto. I'm thinking along the lines of iTunes, where its possible to chose in the preferences how the files are named, and there is some logical directory structure, such as "Artist/Album/01 - Track 1.mp3". These file names are updated to reflect any changes made in iTunes.
    I've heard the argument that I shouldn't ever want to do anything with the files themselves because iPhoto can do everything I would ever want to do, but I want to organize the files so that not all of my organizational work is lost if I decide to stop using iPhoto and transition to a different system. Any suggestions would be appreciated.
    Thanks,
    Adrian

    Adrian
    No it's not possible.
    You can rename the files before bringing them into iPhoto, you can rename them with the titles on Export (Use the File -> Export command, it gives you the option to use the title and filename) but when it's inside iPhoto you cannot rename the files.
    However, all is not entirely lost. Using Film Rolls (View -> Film Rolls) you can move pics between rolls, name rolls, create rolls and so on, as long as you do this in the iPhoto Window, and these changes will be reflected in the iPhoto Library Folder.
    If at some point you decide to chuck iPhoto then (if the new app won't read iPhoto database files) you can simply export each album you've created to a Folder (using the File -> Export command as I suggest above), this, along with exporting slideshows will preserve your organisational efforts.
    The iTunes database has a rather simple job to do: track a file and it's assorted metadata. iPhoto, on the other hand, tracks a file and it's assorted metadata, plus a Modified version, plus a thumbnail. If you consider what happens when you edit a pic, for instance - Copy Original, perform edit, save modified version, remove Original Thumbnail and then create new one - you can see it's a rather more complex job.
    Finally, the standard warning: It is strongly advised that you do not move, change or in anyway alter things in the iPhoto Library Folder as this can cause the application to fail and even lead to data loss. Any changes you make must be made in the iPhoto Window.
    Need more info? by all means post again.
    Regards
    TD

  • Changing file name to iphoto title

    Hi I understand that I can export a photo from iphoto with the iphoto title but I have over 6000 pics in iphoto. Is there a way to save the iphoto title as the file name without individually exporting then importing back into iphoto? The main reason I want to have the iphoto titles for all of these pics is to save the double, sometimes triple handling involved if I am looking for the pics in other places or trying to send large numbers of photos to others and they receive them as file names not iphoto titles when i email them (or I have to keep opening them to see what they are in other areas-like the picture library for instance)? Does apeture allow you to keep a title as a file name? I often download over 100 pics at a time from my camera directly into iphoto. The thumbnails allow me to edit information including title without individually opening each pic. If I don't import from my camera directly into iphoto what other options do i have that are not going to be time consuming? thanks

    Welcome to the Apple Discussions.
    Is there a way to save the iphoto title as the file name without individually exporting then importing back into iphoto?
    No. iPhoto tracks the pics by their path on the HD and this would change the path. iPhoto will then lose the pics.
    The main reason I want to have the iphoto titles for all of these pics is to save the double, sometimes triple handling involved if I am looking for the pics in other places
    Anywhere you search for the pics you can search on Title, you don’t need to use Filename.
    to send large numbers of photos to others and they receive them as file names not iphoto titles when i email them
    If they are using any sort of Photo aware app to view them, they will see the titles.
    or I have to keep opening them to see what they are in other areas-like the picture library for instance
    But why would you be doing that? That’s what your Photo Manager is for.
    If I don't import from my camera directly into iphoto what other options do i have that are not going to be time consuming?
    Use Image Capture to move the pics from your Camera to the HD. Rename the files and then import them.
    I really don’t think it’s necessary to actually rename the files. IF you can describe your workflow for searching or accessing the pics I think we might be able to suggest an alternative way to access them without or without opening iPhoto.
    Regards
    TD

  • Files arranged by date added, but changing file name changes date added

    I've got my Downloads folder set to view (in the Finder) by "date added", a very useful feature. However, if I change a file name, the "date added" changes to that new time, and "date modified" stays the same as it was. This doesn't make sense to me... isn't date added just that, when it was added to the folder? Why would this happen? Any workarounds or suggestions?

    You should use the 'File/Directory Info' functionality.
    This will return the last modificatoin of the file.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

Maybe you are looking for