Script to SaveForWeb with different file name

Can someone direct me to a script that can take the file and SaveForWeb in different versions and append different text to the filename?
For example, say I've got a file called "myPhoto".  I need a script that saves it as  JPEG called "myPhotoPOWERPOINT" and a GIF called "myPhotoWEB"
Is this possible?
Thanks to everyone for your time

This script will export the activeDocument as a jpg and gif
function exportSFWJpg( doc, saveFile, qty ) {
     var exportOpts = new ExportOptionsSaveForWeb( );
     // see guide for other options
     exportOpts.format = SaveDocumentType.JPEG
     exportOpts.includeProfile = true;//default false
     exportOpts.quality = qty;
     if ( saveFile.exists ) saveFile.remove( );
     doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
function exportSFWGif( doc, saveFile, qty ) {
     var exportOpts = new ExportOptionsSaveForWeb( );// default format is gif
     // see guide for other options
     if ( saveFile.exists ) saveFile.remove( );
     doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
var doc = activeDocument;
var docPath = decodeURI( doc.path );
var docName = decodeURI ( doc.name );
docName = docName.match( /(.*)(\.[^\.]+)/ ) ? docName = docName.match( /(.*)(\.[^\.]+)/ ) : docName = [ docName, docName, undefined ];
var saveName = docName[ 1 ];
exportSFWJpg( doc, new File( docPath + '/' + saveName + 'POWERPOINT.jpg' ), 80 );
exportSFWGif( doc, new File( docPath + '/' + saveName + 'WEB.gif' ) );

Similar Messages

  • IDoc to File with different file name and data based on the IDoc header dat

    Hi,
    I got a requirement to implement IDOC to file senario.  In this the Converted file should have the file name and file content based on IDoc Header data.  Means If one of the IDoc header field value is
    'A'  - then the file name recieved by reciever system should be 'A.txt' and with the columns A  B  C  D  F.
    'B'  - then the file name recieved by reciever system should be 'B.txt' and with the columns C  D  F.
    In both the case IDoc message type is same.
    Please suggest me what i need to do to achieve this.
    Thanks in Advance. ...
    Regards
    Sri

    Hi,
    As per my requirement, we need to create one file for each IDoc based on IDoc header data. SAP program generates 10 IDocs for each run. All 10 IDoc's message type is same.  Each IDoc has one header record with the file name. Base on the  name in the IDoc header record, file needs to be created with different columns and file name. Means..
    IDoc 01- Header Description contains 'A' - than file will be generated should have name as 'A.txt' and columns 'parent'  'child' 'descripion'.
    IDoc 02- Header Description contains 'B' - than file will be generated should have name as 'B.txt' and columns 'Name' 'Department' 'Description'.
    IDoc 10- Header Description contains 'J' - than file will be generated should have name as 'J.txt' and columns 'Order No'  'Materail' 'Description'.
    Hope this will give more clarity on my requirement. Please let me if you are still not clear on requirement.
    Thanks for your all help..
    Thanks & Regards
    Sreeni

  • Mutiple sender files and receiver files with different file names

    Hi All,
    Following is my scenario: File (FTP) --> XI --> File (NFS actually SAP system)
    I have 5 source files like ABC<b>1</b>_DateTimeStamp, ABC<b>2</b>_DateTimeStamp, ABC<b>3</b>_DateTimeStamp, ABC<b>3</b>_DateTimeStamp and ABC<b>3</b>_DateTimeStamp.
    I can use single sender file FTP adapter with file name ABC* which picks up all 5 files, but can I use single receiver adapter to create 5 different files with the following file names: ABC1, ABC2, ABC3, ABC3 and ABC3 ?? And last 2 files (ABC3 and ABC3....same name) should be created after 30min and 60min of first ABC3 file. We have to do this because we have jobs scedule on SAP side with variants having file names.
    Is it possible to achieve using single sender/receiver file adapter??
    If not any suggestions how to do this scenario?? 
    Thx
    Navin

    Navin,
    I doesn't know whether its feasible for you or not. Please see the below option
    Create 3 Sender  comm.channels and 1 Receiver comm.channel. In Sender /Receiver file adapter check the Adapter Specific Message attributes.
    I'm suggesting the soln using BPM.
    In IR, Create 3 Outbound Interface (Abstract) and create 1 Inbound Interface(Abstract).
    First 2 comm.channel and 2 Oubtound interface refers to file 1 & file2 respectively.
    The 3rd comm.channel and 3 Outbound interfaces refers to file3 & file4& file 5 .
    Please see the BPM design.
    http://www.flickr.com/photo_zoom.gne?id=698877499&size=o
    Note : Navin the above suggestion is my thought, I think it will work. U can juz give a try.
    Best regards,
    raj.

  • Need to generate multiple error files with rule file names during parallel data load

    Hi,
    Is there a way that MAXL could generate multiple error files during parallel data load?
    import database AsoSamp.Sample data
      connect as TBC identified by 'password'
      using multiple rules_file 'rule1' , 'rule2'
      to load_buffer_block starting with buffer_id 100
      on error write to "error.txt";
    I want to get error files as this -  rule1.err, rule2.err (Error files with rule file name included). Is this possible in MAXL? 
    I even faced a situation , If i hard code the error file name like above, its giving me error file names as error1.err and error2.err. Is there any solution for this?
    Thanks,
    DS

    Are you saying that if you specify the error file as "error.txt" Essbase actually produces multiple error files and appends a number?
    Tim. 
    Yes its appending the way i said.
    Out of interest, though - why do you want to do this?  The load rules must be set up to select different 'chunks' of input data; is it impossible to tell which rule an error record came from if they are all in the same file?
    I have like 6 - 7 rule files using which the data will be pulled from SQL and loaded into Essbase. I dont say its impossible to track the error record.
    Regardless, the only way I can think of to have total control of the error file name is to use the 'manual' parallel load approach.  Set up a script to call multiple instances of MaxL, each performing a single load to a different buffer.  Then commit them all together.  This gives you most of the parallel load benefit, albeit with more complex scripting.
    Even i had the same thought of calling multiple instances of a Maxl using a shell script.  Could you please elaborate on this process? What sort of complexity is involved in this approach.? Did anyone tried it before?
    Thanks,
    DS

  • Help with add file name problem with Photoshop CS4

    Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
    Script follows:
    // this script is another variation of the script addTimeStamp.js that is installed with PS7
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.INCHES;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "Lower© ";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = " ";
    // Set font size in Points
    myTextRef.size = 10;
    //Set font - use GetFontName.jsx to get exact name
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 0;
    newColor.rgb.green = 0;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 10, 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    you might want to try the scripting forum howard:
    http://www.adobeforums.com/webx?13@@.ef7f2cb

  • Save As with suggested file name and folder

    I would like the user to be able to press a save button on the pdf and the "Save As dialogue box" pops up pre-populated with a file name and location choosen. The user can then choose to name the file something otherwise or select a new location. I would just like to save them the steps of copying the field data and finding the correct folder (deeply buried on server) however to place the finished document in.
    This doesn't seem to require a trusted function, but how do I suggest the file name based on a field name in the document. And how do I suggest the folder the document should be saved into?
    Thanks in adavance.

    Hi,
    you need a folder level script to use the browseForDoc method.
    http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf#page=10 4

  • How to save a form in a different file name?

    Hello All,
    I have a form which has 7 pages. I have 3 buttons which are for submitting PDF,XML and print button. I do not want to keep SaveAs button.
    What I need : When the user completes all the required fields and clicks on SubmitAsPDF or SubmitAsXML then it will prompt the user to save the form in a different file name. After the user has saved the form in a different file name then it should submit the form to the required mail ID. How to best accomplish it ?
    Thanks.
    Bibhu.

    Hello Niall,
    Thanks for the help. I used a hidden field whose name is "CurrentFileName" then in the docReady event of this hidden field I used the following script.
    this.rawValue = event.target.documentFileName;
    Then in the mouseUp event of the submit button I used the follwing script.
    if(form1.Page1.CurrentFileName.rawValue == event.target.documentFileName)
                             app.alert("Please save this form in a different file name before submitting !");
                             app.execMenuItem("SaveAs");
    But problem is : As the file is saved in a different name the script fires again and again if we click the submit button prompting the user to save the form in a different file name , but the user has already saved it in different file name .How to get rid of it ?
    Thanks.
    Bibhu.

  • Export with dynamic file name

    Hi everyone.
    I want to know how export oracle tables with dynamic file name on windows XP platform.
    bye.

    You'd have to generate the export command-line or par file using a script -- Windows or SQL !
    It would be easy to use SQL to generate the script.
    So you could have a BATch file that
    a. Calls the SQL to generate the export command-line or parfile
    b. Executes the export
    even possibly run in a loop.
    Hemant K Chitale

  • Replace Unknown Source in EcmaError (JSR223) with actual file name

    Hopefully someone here knows how to do this:
    In my code, all of the scripts are contained in .js files. Whenever one of the scripts contains an error, I get this:
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "nonexistant" is not defined. (<Unknown source>#5) in <Unknown source> at line number 5
    What bugs me is the <Unknown Source>. Multiple files are in one ScriptContext, and it can be hard to track down an error. It also looks horrible.
    Is there a way to replace <Unknown Source> with the actual file name? None of the methods I see support passing a File object, so I'm really confused here.
    Cross posted (and unanswered) at:
    http://stackoverflow.com/questions/2885120/replace-unknown-source-in-java-rhino-jsr223-with-actual-file-name
    http://www.javaprogrammingforums.com/exceptions/4465-replace-unknown-source-ecmaerror-jsr223-actual-file-name.html
    http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino
    http://mozilla-xp.com/mozilla.dev.tech.js-engine.rhino/Replace-Unknown-Source-with-Script-file-name

    You may need to set compile debug option set to true.
    I am not sure if my tip is useful for you, anyway good luck.

  • Adobe flash error: unable to save the document please try to save it to a different file name

    Hi,
    I am editing few fla files with my Adobe Flash Professional. Suddenly it stopped saving them and is giving me an error; unable to save the document as... please try to save it to a different file name or to a different location.
    i changed the location to save the files, but I still receive the same error.
    Is there any one who knows how to deal with this error?
    Thanks,

    close flash.  right click its icon or start program and click "run as administrator".  save your fla. 
    if that fails: restart your computer, create a new directory on your desktop and save a test fla (eg, named test) to that new directory.  any problem?

  • Saving documents with similar file names

    When saving documents with similar file names, I used to be able to hit save as button and go to the file folder I wish to use. I could then click an existing file in the folder to draw in the name and then just modify it slightly to create the new name.
    In Reader DC I get an error saying this is a read only file an can not be saved.  I can save the file if I use a different file name but then I have to go in and rename the file. i.e. if I have a weakly report that I save, I may have the file name "Installerspayroll.we.04.25.15.pdf."
    I used to be able to click on the existing file name to bring it into the name box and then just change the date. The updated version is not allowing me to do that, creating more work.

    I thought you were referring to an admin account within the Adobe program. I am an admin on the machine I am signed into and using while having these problems
    Thank you for this opportunity to share our expertise,
    Michael Mallary
    Treasurer
    Mallary Carpet & Flooring, Inc.
    410-766-6992
    www.mallarycarpet.com<http://www.mallarycarpet.com>
    Earning your unsolicited referrals
    is our number one priority

  • Active duplication with different DB name

    Hi,
    I am trying to duplicate a Primary database in another server with different db name. On firing the duplicate target database for standby from active database nofilenamecheck i face ORA-01103: database name 'ORADB' in control file is not '11GDB' error. i even tried some other duplication commands by surfing in internet but nothing worked.
    Primary DB
    db name : ORADB
    OS : OracleLinux 5
    version : 11.2.0.1.0
    Standby DB
    db name : 11GDB
    OS : OracleLinux 5
    version : 11.2.0.1.0
    Both the db is running in ASM with different diskgroup name. The below shown in the content of the Standby database pfile.
    11GDB.__db_cache_size=314572800
    11GDB.__java_pool_size=4194304
    11GDB.__large_pool_size=4194304
    11GDB.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
    11GDB.__pga_aggregate_target=318767104
    11GDB.__sga_target=478150656
    11GDB.__shared_io_pool_size=0
    11GDB.__shared_pool_size=146800640
    11GDB.__streams_pool_size=0
    *.audit_file_dest='/u01/app/oracle/admin/11GDB/adump'
    *.audit_trail='db'
    *.compatible='11.2.0.0.0'
    *.control_files='+STDBY/11gdb/controlfile/current.260.788911153'
    *.db_block_size=8192
    *.db_create_file_dest='+STDBY'
    *.db_domain=''
    *.db_file_name_convert='+DATA','+STDBY'
    *.db_name='11GDB'
    *.db_unique_name='11GDB'
    *.diagnostic_dest='/u01/app/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=11GDBXDB)'
    *.FAL_CLIENT='11GDB'
    *.FAL_SERVER='ORADB'
    *.log_archive_config='dg_config=(ORADB,11GDB)'
    *.log_archive_dest_1='LOCATION=+STDBY valid_for=(all_logfiles,all_roles) db_unique_name=11GDB'
    *.log_archive_dest_2='service=ORADB LGWR async valid_for=(online_logfiles,primary_role) db_unique_name=ORADB'
    *.log_archive_dest_STATE_1='ENABLE'
    *.log_archive_dest_state_2='ENABLE'
    *.log_file_name_convert='+DATA','+STDBY'
    *.memory_target=796917760
    *.open_cursors=300
    *.processes=150
    *.remote_login_passwordfile='EXCLUSIVE'
    *.standby_file_management='AUTO'
    *.undo_tablespace='UNDOTBS1'
    Plz anyone tell me where it goes wrong.
    Regards,
    007

    I am trying to duplicate a Primary database in another server with different db name. On firing the duplicate target database for standby from active database nofilenamecheck i face ORA-01103: database name 'ORADB' in control file is not '11GDB' error. i even tried some other duplication commands by surfing in internet but nothing worked.When you duplicate from primary to standby. Ensure the DB_NAME same on both primary and standby and of course you can have different DB_UNIQUE_NAME in both primary and standby databases.

  • HT204053 i RECENTLY PURCHASED ANOTHER IPHONE.  MY INTERNET IS NOT WORKING.  I JUST CREATED AN APPLE ID.  WHAT'S NEXT?  I NOW HAVE TWO DIFFERENT ACCOUNTS WITH DIFFERENT USER NAMES.  HOW CAN I USE ONLY ONE ACCOUNT FOR ITUNES, ICLOUD APPLE ID ETC???

    I RECENTLY PURCHASED ANOTHER IPHONE.  MY INTERNET IS NOT WORKING.  I JUST CREATED AN APPLE ID.  WHAT'S NEXT?  I NOW HAVE TWO DIFFERENT ACCOUNTS WITH DIFFERENT USER NAMES.  HOW CAN I USE ONLY ONE ACCOUNT FOR ITUNES, ICLOUD APPLE ID ETC???

    Welcome to the Apple community.
    iTunes and iCloud and different accounts, you will need to delete both accounts from your device before adding the new details in their place.
    For iCloud go to settings > iCloud, scroll down and hit the delete button. You can then sign back in using your correct details. For iTunes go to settings >store, tap your account ID and then sign out, you can then sign back in using your correct Apple ID.

  • I just order 8 calendars from iPhoto and they came to me fine. Now I need to order two more but when I go thru the process I get a message  saying:unable to assemble calendar. There is a probleme with the photo with the file name"(Null)"   more........ .

    Would someone be able to explain to me the following issue with Iphoto?
    I ordered 8 same calendars for my soccer team and received them fine. Although a couple of pictures on it are a little off (out of focus). I need to order two more of the same calendars but when I go thru the process ireceive an error message saying:
    "Unable to to assemble  calendar" There is a problem with the photo with the file name "(Null)" The full resolution version of this photo either cannot be located or is corrupt. Please replace this photo or delete it from your calendar.
    How can  I fine this "corrupt" photo? How did it go thru with the first batch of calendars but won't go thru now?
    Thank you for your help.   

    Apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start
    with Option #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • How to pass database logon info to a Crystal Report in a subreport with different server name using VS C #

    Post Author: fabu1971
    CA Forum: .NET
    I could pass the database logon in Reports with subreports but the reports with subreports with different  server name I can not pass the logon information . Do you have any idea how I can do that to pass the database logon with different database or server name ?

    Post Author: quafto
    CA Forum: .NET
    You can use the Subreports collection of the ReportDocument object to access all the subreports in your main report. These are returned as ReportDocument objects. Once you have your subreport as a ReportDocument you can loop through your Tables collection and set the ConnectionProperties to your appropriate Server/Database. For example here is some pseudo code: ConnectionInfo boConnectionInfo = new ConnectionInfo();boConnectionInfo.ServerName = "serverName";boConnectionInfo.DatabaseName = "databaseName";boConnectionInfo.UserID = "username";boConnectionInfo.Password = "yourpassword"; foreach(ReportDocument boSubreport in mainReport.Subreports){    foreach(Table boTable in boSubreport.Database.Tables)    {        TableLogOnInfo boTableLogOnInfo = boTable.LogOnInfo;          boTableLogOnInfo.ConnectionInfo = boConnectionInfo;          boTable.ApplyLogOnInfo(boTableLogOnInfo);          boTable.Location = "newtablelocation";     }}

Maybe you are looking for