Creating actions to save files

Hello all,
I want to have an action that takes the input file and creates a JPEG for web and places it in the same folder that the input file is located.  Is this possible? Normally, when creating an action to Save for Web, it will save the file in a single specific location, but I need to have it save to whatever folder the original file is in, no matter where that file is.
Secondly, is it possible to make the action add text to the end of the filename?  I would like it to add the text "-web" to the end of the file.
I hope that's clear, let me know.  Thanks for your time, everyone.

This is where a script comes in.
This should do it...
#target photoshop
function main(){
if(documents.length){
var newName = decodeURI(activeDocument.name).match(/(.*)\.[^\.]+$/)[1];
newName = newName +"-web.jpg";
var saveFile = File(decodeURI(activeDocument.path) +"/"+ newName);
if(saveFile.exists){
var result = Window.confirm("This File Exits!\nWould You Like It Overwritten?", true, "File Exists");
if(!result) return;
saveFile.remove();
SaveForWeb(saveFile,80); //Change quality to suit
main();
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb();
   sfwOptions.format = SaveDocumentType.JPEG;
   sfwOptions.includeProfile = false;
   sfwOptions.interlaced = 0;
   sfwOptions.optimized = true;
   sfwOptions.quality = jpegQuality; //0-100
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

Similar Messages

  • Can I create action to Save As...  and change only one character of the original file name?

    I'm working on a group of  files(25-28) at a time. I have to save each one as a photoshop .raw file and change the first character of the file name. the rest of the file name must remain the same. I then close the original file with no changes. I tried to create an action for this. The only problem is that the next file overwrote the file I used to create the action.  Is it possible to creat an action to save as... and keep the file name of the new file but chage the first character to the same one used in the recording?

    Good day!
    I think what you are describing is not possible with Actions.
    Scripting would be an option, but more convenient might be simply saving the files with unchanged names and then edit the names of  the whole bunch in Bridge in one go (Tools > Batch Rename).
    Regards,
    Pfaffenbichler

  • Creating Action to Save a Copy at Ill 8?

    Illustrator v8 is the magic version for nearly all current 3D applications in the world. Anytime I want to import a vector spline into a 3D app, it'll always want it as a v8 Illustrator file.
    I'm trying to create an Action that'll automatically save a copy of my current open document to v8. But Actions doesn't seem to record any of Options panels when saving a file.
    Any ideas how to do this?

    Nope. Seems like the Action recorded the location and name of the dummy file I saved when recording the Action.
    Anytime I play the Action, it saves a copy to that same folder with the same name.

  • How do I create an action that saves files as JPG in the same folder?

    Hey folks!
    So I'm sitting at work, trying to optimize my workflow a bit..
    What I'd like, is a droplet, that will allow me to open PSD's and save them as JPG in a new folder inside the original folder.
    Like the Image Processor that makes a new folder named 'JPG' but without opening the dialog box and having to press buttons.. Drag-drop-done
    Sitting on Imac with OS X 10.10.2 with Photoshop CC 2014.
    Hope you can help
    Regards
    Emil Rye

    Use scriptListener to create the code for adjusting the hue.  find the line in the code that denotes the change in hue replace that value with a variable that stores a random number:
    var rangeForRandomNumber = 200
    var offsetForRandomNumber = -100
    var randomNumber = Math.random() * rangeForRandomNumber + offsetForRandomNumber

  • How do you you create, write, and save files?

    I created a VI to read 8 channels and display the waveform, which it does. But whenever I try to set up a way to save the data it never works. I want it to give me the option to create a new file, then write the data to there, and save it, and then close the file. How should I go about this?

    I have not opened your attachment, yet.
    Before doing so, you will need to decide if you want to write to:
    a) a measurement file
    b) a regular text file, or
    c) MS Excel Spreadsheet
    The method to write to the above are quite different.  Please decide and let us know..
    R

  • Make photoshop action that saves file with specific filename

    Is there a way to make a photoshop action that does a SaveForWeb, but adds text to the original filename when saving?
    For example, if I open a file called "coverPage," and I want the action to do SaveForWeb as a JPEG, can I have it save  as "coverPageWEBVERSION"?
    Thanks for your time and help

    No this is one thing you will need scripting for.
    They really should have introduced some modification to the Save dialog that allows file naming additions or modifications triggerable within actions. But they never did.
    As a workaround, Bridge is a good tool for renaming, because naming convensions can be SAVED and quickly applied to groups of files. Not often known fact  - On a mac there are also OS scripts that can do the same thing. There is a script called 'rename items' hidden away somewhere. This is accessable by Control or right clicking on a group of files, and going through the 'automate' submenu

  • Can I use the Time Capsule as an storage drive? Can I create folders and save files on it as with a external hard drive?

    I want to know if I can use my Time Capsule as a storage hard drive instead of only use it to back up my Mac

    Bravenewcharles wrote:
    Ok, so while I edit my files in my Mac that will occupy some space on its hard drive that will be backed up in the TC. Does that mean that I will occupy two hard drives on the same stuff?
    Exactly.  That's kinda the definition of a backup.  When (not if) something awful happens, like your Mac being lost or stolen, or the HD failing or getting corrupted, or you accidentally change or delete some stuff, you have a backup you can recover.
    What will happen when my Mac's hard drive is completely full?
    Don't let it.  Delete things you don't need.  If you can't delete enough, as Neil says, get an external HD for the "overflow" that won't fit, then let Time Machine back up both your Mac and the external.  See Time Machine - Frequently Asked Question #32 for more info.
    Message was edited by: Pondini

  • Trying to create an action to save to web

    When I create an action to save to web, it always saves the file name in the action. Every save after that creates a file to replace the previous one. The actions that came with AI CS4 save the file as the file name.
    How can I create an action to save to web as the file name of the open file?
    Dean

    Check the naming conventions in the save for web panel itself. Unfortunately they introduce their own redundant naming which may conflict with conventional save steps in the action...
    Mylenium

  • I saved my Form Central spreadsheet file once as a excel file but it will not allow me to save it a second time as an excel file.  It says that I cannot complete this action because the file me be open in another application, but it is not open in another

    I saved my Form Central spreadsheet file once as a excel file but Forms Central will not allow me to save the file a second time as an excel file.  I am informed that I cannot complete this action because the file me be open in another application, but it is not open in another application. What is the problem, and how do I solve the problem.  Thank you. Jeff

    First check the version of the document with Jongware's script "Identify.jsx" (ExtendScript/JavaScript).
    You can find it here:
    [Ann] Identify Your InDesign File
    If it is CS 5.5 or above, you need someone to open it in the version the script says and export an IDML representation from that. Another way would be to install a 30days version of CS6 or above (CC) and do it yourself.
    In regards of the script showing a result for InDesign files higher than CS6:
    CS7 = CC v9
    CS8 = CC v10 = CC-2014 or CC2014.1
    Uwe

  • Can I create an automatic custom file save name/path once I click digital signature field?

    Hi,
    What I'm trying to do is once I click on a digital signature and I add my digital signature it requires me to sign it.  I want to know if there's a workaround to where once I click it it will automatically save to a file name based on a field and to a pre-determined directory?  Say, if I want it to save to a users desktop.  My supervisor is wanting to eliminate his employees having to change the file name to the format he wants and selecting the save location and make it automatic for everyone to have it saved at the same location on their computers. 
    Will likely have everyone in the office create a folder named 'Leave Requests'.  This will be the location on the desktop where all these automatically saved files would go.  The custom file name would be Emp_Name + "Leave Request" + Date where Emp_Name and Date are 2 variables that are user inputted field values on the form.  I have looked around but there doesn't seem to be too much on this one.  I do realize I can't create a custom 'Save As' location and path name but I have read a little about creating a custom automatic save feature and wanted to know if I could implement that.  Here is the information I read about:
    http://acrobatusers.com/tutorials/print/how-save-pdf-acrobat-javascript
    I appreciate all help any of you can give me in this matter.  Thanks!!!

    This tutorial is great!
    http://mydesignpad.com/create-a-complex-html-email-signature-for-mail-on-mac-os- x-10-9-mavericks

  • Need action to save a copy with original file name with suffix

    Hi All,
    I am using photoshop 7 (yeah its old, but working fine for me for general purposes). The problem is I have got this new task where I have to provide 3 copies of the same image but with different portions of it. I have several images (.jpeg) which I need to crop two parts of the image and save as two new image files. The requirement is that I need the copy images to bear the same name as the original and with a suffix to identify which cropped portion of the image is it. example, original file name is AB1001.jpg (1600x1200), 1st cropped image name to be AB1001_P.jpg (200x250) and the 2nd cropped image name to be AB1001_Q.jpg(100x180). I have around a 180 files, so need to do it in a batch, pls suggest how can it be done.
    Any help in this regard is much appreciated.
    Regards
    Chhuppa Rustam

    While a script would probably be best, photoshop 7 requires
    you download a scripting plugin which may or may not install
    in photoshop 7 depending on your version.
    You can probably do what you want with actions. The file naming part
    is not hard, but i have a couple of questions about the cropping.
    Are all the images the same size and are the crops in the same position for each?
    In other words on the P crop (200x250), is the crop in the same position on each
    image or different for each?
    MTSTUNER

  • How to I record an Action to Save As that doesn't include a file name??

    Hi -
    I have an Action that will crop and scale a PDF file then Save As a JPG to a destination folder.  The problem is that when I recorded the Action I did so with a file named ABC.PDF and Saved it as ABC.JPG - and now every file saved with this
    Action is named ABC.JPG
    This makes it impossible to use with a bunch of different files.  One file gets overwritten multiple times with the same name.  The  file name ABC.JPG is "burned" into the Action.
    SO - how do I record an Action to Save As without including a file name??
    TIA your help on this crazy problem -
    Josh
    CS5 on Windows7

    PeterK - thanks for the reply.  I tried that already - initially actually. 
    I even tried blanking out the field so I would save a file with NO name.  PSD added it's own .jpg and saved it like that.  Every file after that over wrote that one too so after using the Action on 6 files I still only had one ".jpg" in the folder.
    I was hoping that there was a setting or preference somewhere.  SInce this is Windows might it be OS related?

  • Action which saves incremental versions of the current file name.

    I have several folders of PNG files I want to hue to differnt colours and then save a version in each colour.
    I sucessfuly recorded an action that makes the hue adjustments and saves files, the problem I'm having is the action uses the name and location of the file I used when recording the action.
    When it saves each file I'd like it to keep the current file name and add a suffix if needs be. File-1.png, File-2.png etc.
    I'm using CS5.
    Any advice would be brilliant.
    Thanks.

    Use the image processor script and remove the save steps from your action.
    Mylenium

  • How to create a multi-page view PDF from Ai save file.

    Dear all.....
    Good day!
    I wish that some one can help (answer) me on the save file from ai to PDF as multi-page view.
    I have log in the adobe follow the instraction, but, still can't fine the way to select from the <save type> as multi page,
    * Selact the "Create Multi page PDF" is the something when's wrong?
    my purpose is to view it in Adobe Reader as scrolling Multi page1 page2 and page3.....
    Please help......
    Best Regards
    David Chan

    You are in the wrong forum. Adobe Reader can't create PDF documents. Try the forum for Ai.

  • SP2-0110: Cannot create save file "afiedt.buf"

    i have a remote database connectivity authenticated by a username/pwd.
    i connect into the database(SQLPLUS) thro a CITRIX SERVER client.i have all the privileges of an oracle developer for my username and i have complete access to my
    schema objects.
    But when i try invoking the editor afiedt.buf using the command < ED > in SQLPLUS i get the
    following message
    SP2-0110: Cannot create save file "afiedt.buf"
    when i try to spool an output to a file (one.txt) i get the following error
    SQL> spool one.txt
    SP2-0332: Cannot create spool file.
    could anybody suggest how i could resolve these issues.
    Thanx

    Just be aware, because you are connecting through a Citrix server, that your "current directory", as far as sqlplus is concerned, is on the Citrix server.
    Depending on your site, you may have a hard time convincing the Citrix admin to give you write access on their server. You should try to get the Oracle client, which includes sqlplus, installed on your local machine.
    TTFN
    John

Maybe you are looking for