My Script Saves My Files In Incremental file names but can't save to original folder?

hi everyone,
so after a few hours of browsing the forum, was able to scotch tape this script together so it allows me to save my files in incremental file numbers.
- i create an action to edit the file and then in that action, i run this script x-amount of times.
- it works as i tested it a few times.
but here are my questions that i can't figure out.
1. right now it says to a folder that i have to designated. how would i edit this code so it'll save in the same folder as the file i am editing?
2. so far it saves as a jpeg. does anyone know the syntax to use for a gif?
and if you're kind enough...let's say i have an animated gif file, i can't edit it in photoshop so i have to use imageready but how do i replicate the above in imageready since we're on the same topic.
THANKS!!! code is below:
// This script will save the active document to a folder with an incremental sufix
// Change the options below to match your needs
var saveFolder = new Folder( 'C:\\test' );
var saveExt = 'jpg';
var saveSufixStart = '_';
var saveSufixLength = 3;
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = 8;
// End of user options
//==========================================
function zeroPad ( num, digit ){
   var tmp = num.toString();
   while (tmp.length < digit) { tmp = "0" + tmp;}
   return tmp;
var docName = decodeURI ( activeDocument.name );
docName = docName.match( /(.*)(\.[^\.]+)/ ) ? docName = docName.match( /(.*)(\.[^\.]+)/ ) : docName = [ docName, docName, undefined ];
var saveName = docName[ 1 ]; // activeDocument name with out ext
var files = saveFolder.getFiles( saveName + '*.' + saveExt );// get an array of files matching doc name prefix
var saveNumber = files.length + 1;
//alert("New file number: " + zeroPad( saveNumber, saveSufixLength ));
var saveFile = new File( saveFolder + '/' + saveName + '_' + zeroPad( saveNumber, saveSufixLength ) + '.' + saveExt );
activeDocument.saveAs( saveFile, jpgSaveOptions ,true ,Extension.LOWERCASE);

ImageReady? Which version of Photoshop do you use?
1. right now it says to a folder that i have to designated. how would i edit this code so it'll save in the same folder as the file i am editing?
You need to amend the line
var saveFolder = new Folder( 'C:\\test' );
accordingly.
2. so far it saves as a jpeg. does anyone know the syntax to use for a gif?
There are examples on the Forum, for example
http://forums.adobe.com/message/3928843#3928843

Similar Messages

  • I imported an hour of video into iMovie HD and cut it down to a 33 sec clip, and emptied the trash.  When I save the project, the file size is 20Gb.  How can I save just the 33 sec clip?

    I imported an hour of video into iMovie HD and cut it down to a 33 sec clip, and emptied the trash.  When I save the project, the file size is 20Gb.  How can I save just the 33 sec clip?

    Non-destructive editing is an important feature of iMovie HD 6.
    iMovie preserves the entire copy of every clip you place into your movie in case you change your mind at a later stage.
    So, if you have cut out one minute from a 45 minute clip, iMovie will have stored two complete copies of that clip. This is why is helps to set import as 3-5 minute clips rather than one huge chunk. As DV runs at 13GB per hour your project files can get very big.
    One workaround is to complete the editing of a section of the movie, then export that to Quicktime: highlight the clip/s, choose Share-Quicktime, turn on Share selected clips only, and choose Full Quality from the pop-ip menu.
    Once you have saved the stand-alone clip to your hard drive, you can re-import it into your project using the File/Import command, and delete the original long clip/s from the project.

  • Webi report (User modify report but can't save)

    Hi Guys,
    I have one ques. regarding Webi report (Access Level), that User can view & modify a report but can't save.
    Kindly reply ASAP.
    Thanks

    hi,
    General -> Edit this Object (should be Granted)
    Application -> Web Intelligence ->
    "General Rights for Web Intelligence"
    - Edit this object
    In case of WEBI Rich Client, Grant the following
    "Specific Rights for Web Intelligence"
    - Web Intelligence Rich Client : Save a document locally on the file system
    - Web Intelligence Rich Client: Save a document for all users
    Regards,
    Vamsee

  • DIS installed but can't save Word document in CS

    I installed the CIS but can't save Word/Excel/PPT 2003 files using save as. What I do wrong and/or what I missed? There's no info on CIS Install/User Guides.
    Using Windows Explorer, everything Works fine.
    Some info:
    UCM: 10.1.3.5.0 (090707) (Build:7.2.4.11)
    DesktopIntegrationSuite 2009_07_02 (8.2.0.959)
    CoreWebdav 2009_06_17 (build 30) br-10g-10.1.3.5-release
    Thanks!

    What did you install?
    DIS or CIS - you mention both.
    CIS is something quite different that provides an API that exposes the UCM services within J2EE applications.
    What you need to install are the Windows client components of DIS. If you do this there is (if I remember rightly) an option in the install wizard about which desktop applications you would like DIS to integrate with (word excel...).
    So either
    1.Install DIS (if you have not done so yet)
    2.Update your DIS install (just run the installer again or go Settings > Control Panel > Add Remove Programs > Change or Remove programs andtick the box for word integration
    Tim

  • I capture a video but can't save it .How to halndle the problem via JMF?

    Hi everyone, I'm starting to use JMF and faced the problem
    The problem is to save captured video in .avi or .mov formats.I managed to capture and play it in a player, but can't save it .On the other hand when I used processor to capture and save the video , I've succeeded .But my task is to combine these two actions. Give a hint please.
    All kind of replies will be greatly appreciated.
    Edited by: postvard on Feb 25, 2009 12:03 AM

    >
    You need to get the StreamWriterControl on the DataSink, rather than the Processor.I doesn't seem to work.
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.io.IOException;
    import javax.media.CannotRealizeException;
    import javax.media.Control;
    import javax.media.DataSink;
    import javax.media.Format;
    import javax.media.Manager;
    import javax.media.MediaLocator;
    import javax.media.NoDataSinkException;
    import javax.media.NoProcessorException;
    import javax.media.Processor;
    import javax.media.ProcessorModel;
    import javax.media.format.VideoFormat;
    import javax.media.protocol.DataSource;
    import javax.media.protocol.FileTypeDescriptor;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.media.control.MonitorControl;
    import javax.media.control.StreamWriterControl;
    public class MyProcessor extends JPanel {
         private MediaLocator locator=null;
         private Processor processor=null;
         private DataSource dataSource=null;
         private DataSink filewriter=null;
         private Format[]formats=new Format[1];
         public MyProcessor() throws NoProcessorException, CannotRealizeException, IOException, InterruptedException {
              setLayout(new BorderLayout());
              FileTypeDescriptor outputType = new FileTypeDescriptor(FileTypeDescriptor.MSVIDEO);
                   Format[]format=new Format[1];
                   format[0]=new VideoFormat(VideoFormat.YUV);
              locator=new MediaLocator("vfw://0");
              processor=Manager.createRealizedProcessor(new ProcessorModel(locator,format, new FileTypeDescriptor(FileTypeDescriptor.MSVIDEO)));
              Control controls[] = processor.getControls();
              for(Control c:controls){
              if(c instanceof MonitorControl){
              MonitorControl mc = (MonitorControl) c;
              mc.setEnabled(true);
              if (mc.getControlComponent() != null) {
              add("Center", mc.getControlComponent());
              dataSource= processor.getDataOutput();
              MediaLocator dest = new MediaLocator("file:record1.avi");
              try {
              filewriter = Manager.createDataSink(dataSource, dest);
              Control[] dataSink_controls= (Control[])filewriter.getControls();
         for(Control c1:dataSink_controls){
              if(c1 instanceof StreamWriterControl){
                   StreamWriterControl stream_size=(StreamWriterControl)c1;
                   if(stream_size!=null){
                        stream_size.setStreamSizeLimit(30000);
              filewriter.open();
              } catch (NoDataSinkException e) {
              System.exit(-1);
              } catch (IOException e) {
              System.exit(-1);
              } catch (SecurityException e) {
              System.exit(-1);
              try {
              filewriter.start();
              } catch (IOException e) {
              System.exit(-1);
         processor.start();
         //Thread.currentThread().sleep(20000);
    //     processor.stop();
    //               processor.close();
    //               filewriter.stop();
    //               filewriter.close();
         public static void main(String[] args) {
              try {
                   MyProcessor processor1=new MyProcessor();
                   JFrame frame=new JFrame();
                   frame.setSize(300,300);
                   frame.add(processor1);
                   frame.setVisible(true);
              } catch (NoProcessorException e) {
                   e.printStackTrace();
              } catch (CannotRealizeException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (InterruptedException e) {
                   e.printStackTrace();

  • I can download and view PDF docs on my MAC but can not save or print them - Help !

    I can download and view PDF docs on my MAC but can not save or print them - Help !

  • Macbook Pro can open files from Touro ext. hard drive but can't save to it. Solutions without data loss?

    Hello,
    I've looked around for a solution to my problem but I haven't found any specific solutions and I'm not comfortable in trying general ones for fear of loosing my data. Before moving I backed up all my document and music files from my PC to my Touro external hard drive. My main goal for buying this hard drive was to use it to store my itunes music library to save space on my computer and transfer my music from said PC tp my new MacBook Pro after the move. Today I set about doing so and was able to set my itunes up to pulll from the hard drive as well as load all the music I had saved on the hard drive into my MacBook itunes. The trouble came when I tried to download new purchases. It turned out I couldn't because itunes was unable to save them in the new file location on the Touro. I checked into it and I have the same problem with the documents as well; I can open anything already saved on the drive but I can't save any new files. It keeps on telling me I don't have permission to make edits. I'm afraid this mean I have to reformat the Touro for Mac but doesn't that mean I'll lose all that data? Does anyone know of any somlutions that would give me access to the drive without compromising what's already on it? I would just plug it back into the PC and see if I could adjust sharing settings, but it's all the way across the country now. Any help in this matter would be greatly appreciated!
                                                                Thanks,
                                                                     -G-

    It sounds like your HDD was formatted under windows NTFS, which although your mac can read, it cannot write to that file format.
    You will either need to transfer the data to another location while you reformat it as FAT on your mac using Disk Utility. Or you could purchase something like iPartition and change the file format to FAT which might take up to 24hours or so depending on the size of the drive. I have never had a problem doing this before but it's not guaranteed that your data will not be lost doing this.

  • When running an xml publisher report the xml output leads to 9 mb and the excel output file leads to 20 mb.But the output records is originally 4000 records. When copy to new excel it is showing 3.5 mb only. Does anyone knows the answer for this issue?

    When running an xml publisher report the xml output leads to 9 mb and the excel output file leads to 20 mb. The records contained in excel file is 4000 records. When taking the excel records and copy to new excel file the excel file size is 3.5 mb only.Why does the oracle software generates 20mb file?
    Does any one knows the answer please advice?

    Hello,
    This issue is because the Excel output from BI Publisher is MHTML (XML Publisher generates XHTML) not binary .xls.
    MHTML and XHTML are more verbose formats than binary .xls.
    It will be large because the current Excel output is just an HTML and not compressed like PDF. Please use the workaround (save it as .xls file).  This is a known limitation of RTF layout templates.
    BI Publisher Enterprise has a new feature True Excel Templates. The layouts generate binary Excel output.
    Excel Output File Size Generated By BI Publisher is Very Large (Doc ID 760437.1)
    Bogdan

  • I recently had to get a new computer, my list of audible books is there but can't open because original file cannot be found.  how do I find them or redownload them when they are not in my purchased list anymore?

    I recently had to purchase a new computer, after doing so I no longer can open my audible books.  the list is there, but I get an error message telling me that the original file cannot be found.  How can I redownload them when they are not in my purchased list anymore when I go to the Apple Store??

    Downloading past purchases from the App Store, iBookstore, and iTunes Store - http://support.apple.com/kb/ht2519 - enabled with iTunes 10.3 and newer; not available in all countries; apps, books (not audiobooks), music, t.v. shows, and movies (some - not all studios have permitted this). Movies currently available in the USA only. Downloading previously purchased movies and TV shows requires iTunes 10.6 or later.  Discontinued items not available. For items not included in the iCloud list, or locations or computer systems where iCloud is not (yet?) available, you only get one download per fee paid.  Apple notes it is your responsibility to back up your purchases.
    Select the store on the left side of iTunes.
    Click on Purchased on the right side under Quick Links.
    You can re-download your available previous purchases.

  • I'm using Word for Mac. Though there are various instructions on the Internet for modifying the templates, none make sense to me. They instruct to do something I can't follow. I change a template but can't save it to the template folder.

    What the ****.
    OK, I try to change a template using Word for Mac version 14.3.4 2011 edition.
    I make a change to the template but am unable to save the darned thing to the template folder; it asks for a file name like it's a new document. I want to change the blasted template but if I can't save it as a modified template, I've accomplished nothing.
    Does anyone have a solution?
    Thanks

    Support for Microsoft Office for Mac

  • I installed number and shows as purchased but can't save documents why?

    when I commend for save,  there is message " can't save on trial buy serial number, so I installed ,purchased, but still can't save

    You're getting the request for a serial number that means that at some time you had the iWork ’09 trial installed. You need to delete the trial & then reinstall from the boxed DVD or the Mac App Store. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user. The easist way to fix the problem is to use Yvan Koenig's AppleScript that removes the files. You can find it on his box.com account in for_iWork'09 > other_iWork'09 items > uninstall iWork '09.zip.
    Apple's support article on the subject says it's due to having a copy of the trial that is a higher version that the one you've purchased, but I'm not sure that is very common. This problem started with Snow Leopard & it seems to be some code in the iWork installers that doesn't do what it should.

  • See "iPod" Songs in iTunes but can't save them in Library or Music Folder!

    My apologies in advance, folks, I'm a newbie to the Discussions.
    Initially had loaded my iTunes onto a PC and "homeshared" to my Mac. PC died and could not disable homesharing on THAT end. But did disable homesharing on my Mac. Synced by iPod (appears to be a PC model) and all songs showed up under device in iTunes. But, all songs were downloaded from CDs (not iTunes store). So: tried to select all and save to a new folder under music. No dice. Tried "Add to Library" from iTunes File Menu...nada. Since the songs were originally loaded to the iPod from a Windows PC, do I need a utility in order to get them uploaded to my Mac? Really don't want to have to re-record them all (>1000 songs) and know I must be missing something obvious here.
    Please tell me I'm just overlooking a VERY easy step!! I now have 1 (yes, one) song in my Library.
    Your help is really greatly appreciated!

    Hi folks:
    Just in case anyone else experieces this problem (uploading iPod Windows to iTunes Mac, I used iPodDisk freeware (with MacFuse)...loads songs to Finder as organized in iPod and you can drag and drop into iTunes!! Easiest way to get the job done...

  • Can't scan docs to my iMac, epson scans, but can't save in iMac docs

    having trouble scanning to iMac from epson. screen shows its scanning, but then can't save to iMac.

    Which app are you using to see your scans?
    You posted in the iMac forums yet your system info is showing iPhone.
    =========
    When posting in Apple Communties/Forums/Message Boards.......It would help us to know which Mac model you have, which OS & version you're using, how much RAM, etc. You can have this info displayed on the bottom of every post by completing your system profile and filling in the information asked for.
    CLICKY CLICK---> https://discussions.apple.com/docs/DOC-3602
    CLICKY CLICK-----> Help us to help you on these forums

  • How can I save songs from mail to iPad?, How can I save songs from mail to iPad?

    How can I save songs from my mails to iPad?

    Sync with iTunes:
    http://support.apple.com/kb/ht1386

  • Can display Japanese characters but can't save to db properly

    Hello! I'm having quite a predicament here! When getting Japanese characters in the database(characters are as-is), it successfully displays them. I manually put it in the database. But when I try to save to the database using the browser(textfields, submits, connections, etc), it saves as garbage.
    Here's the code on my first page. It only gets user input then submits to another jsp
    <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
    <jsp:useBean id="helper" class="com.ats.equipc.DBHelper" scope="request" />
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    </head>
    <body>
         <form name="formOne" action="testOut.jsp">
              in1:  <input type="text" name="in1" />
              <br>
              <input type="submit" value="submit" />
         </form>
         <%! ResultSet rs = null; %>
         <% rs = helper.doGetQuery("select * from t_test;");
              while(rs.next()) {
                   out.print(rs.getString(1) + "<br>");
         %>
    </body>
    </html>Don't mind the Resultset, I just put it there so I can see the saves.
    My second page. This is where I save the entry
    <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <jsp:useBean id="helper" class="com.ats.equipc.DBHelper" scope="request"/>
    <head>
    <title>Untitled Document</title>
    </head>
    <body>
         <%! ResultSet rs = null; %>
         <% request.setCharacterEncoding("utf-8");
              String entry = request.getParameter("in1");
              out.println(entry);
         %>
         <% helper.doSaveQuery("insert into t_test values('" + entry + "');"); %>
    </body>
    </html>Help please...

    Thanks once again for replying
    I got it to work but its still foggy to me why it does work.
    I replaced the code
    <%! ResultSet rs = null; %>
         <% request.setCharacterEncoding("utf-8");
              String entry = request.getParameter("in1");
              out.println(entry);
         %>with this
    <%! ResultSet rs = null; %>
         <% //request.setCharacterEncoding("utf-8");
              String entry = new String(request.getParameter("in1").getBytes("iso-8859-1"), "utf-8");
              out.println(entry);
         %>Take a look at:
    String entry = new String(request.getParameter("in1").getBytes("iso-8859-1"), "utf-8");Why do I need to specify the charset to "iso-8859-1" when getting the bytes then making it "utf-8" when finally making it into a string?

Maybe you are looking for

  • How to set "Cc" field in Dynamic Email address in Receiver Mail adapter

    I have done the configuration for setting up the dynamic email address using the XSD provided by SAP in note no 748024. It is working fine. Michal's blog “Mail Adapter (XI) - how to implement dynamic mail address.” was a gr8 help in doing this. But t

  • Executing db2 import statement from java

    we have developed an web application using J2EE technology on websphere and DB2 as a backend. I have to now develop a utility for data uploading from Excel to DB2. we can do it using IMPORT statement now i want to know is it possible to execute IMPOR

  • Group Asset Mandatory

    I am purchasing an asset through MM module.  While doing MIGO or MIRO Asset account is debited.  For that Asset capitalization date will take as MIGO/MIRO document posting date. Now i want the capitalization not the document posting date, i want to u

  • Do I need to deauthorize, before authorizing a new PC?

    Do I need to deauthorize, before authorizing a new PC?

  • People tags in Lightroom 6 and Windows Live Photo Gallery

    I think I'm finally ready to make the switch to lightroom from WLPG for photos management. I've used LR for a long time to do the edits but people tags are huge and kept all of my photo management in WLPG. I have 100k organized photos and they are al