Illustrator extend script save() changes file extension

If I open a PDF in Illustrator, make a change, and save using the menu option or shortcut, the file is saved as expected.
If I try to use extend script (i.e. app.activeDocument.save(), or .saveAs()), the file extension is renamed to .ai. How do I keep my original filename when saving with extend script?

Got it working by using .saveAs() with PDFSaveOptions

Similar Messages

  • Change File Extensions (Newbie)

    I want to exchange .html extensions to .php in a folder. Actually, someone showed me how to it with AppleScript. However, someone else told me about Autmator, which looks like a really cool tool. Unfortunately, I can't figure out how to change file extensions with it.
    When I open Automator, I get a little window that lists seven scripts or functions, beginning with Change Extension. If I right-click on Change Extension and choose open with Automator 2.0, I get a bigger window ("untitled") with a long list of actions on the left. Again, I click Change Extensions.
    On the right is a little box titled "Ask for Finder Items." It includes three options:
    Prompt, Start at and Type. But I don't know how to precede. How do I indicate what file extension I want to change from or to?
    I first asked about Automator on a thread at
    http://discussions.apple.com/thread.jspa?messageID=9490359#9490359
    Someone posted an image that shows a second window where you type in the file extensions you want to work with. But I can't figure out how to make that window appear on my program.
    Thanks for any tips.

    Here's a simple solution. Select all the files in the folder by navigating to the folder in the Finder. With the files displayed press COMMAND-A to select them all. Press OPTION-COMMAND-I to open the Inspector window. In the Name and Extension field change the extension from .html to .php. Close the window.
    For more complete control over batch file changes download BatchRenameEm - VersionTracker or MacUpdate.

  • Photoshop will no longer automatically change file extension when I do a "save as".

    I have just now been to Preferences to make desired settings for needed grid lines.  Now Photoshop 9 will no longer automatically change the file extension when I do a "save as".  Does anyone have any ideas or suggestions about this?  I am using a Mac.  Thank you.

    Are you still facing the issue, can you try deleting preferces and then try it.
    If still get no succes please lemme know the scenario you are using for saving file.
    Cheers,
    Sam

  • Power shell script to change the Extension of file

    Hi All,
    i need to change the extension which is as .out file to .xml below is the pwershell script which i used
    $fileName="C:\temp\suj.txt"
    $newExtension="xml"
    [System.IO.Path]::ChangeExtension($filName, $newExtension)
    neither i get any error for the above script nor the extension is changing
    can onayone help me on this

    No worries
    i have used the below script
    Dir C:\temp *.out | rename-item -newname {  $_.name  -replace ".out",".xml"  }

  • 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

  • HT4642 how do I save with file extensions in 09.

    Numbers 08 had a check box to save a file with the extension (it didn't always work when saving to pdf) but 09 doesn't save the file with the extension (.numbers) by default and doesn't have an option to save .pdf when saving as a pdf. Is there a way to change this or is it not necessary? I'm worried that some clients with older versions may not be able to open the file without the extension.

    Hello blinkless,
    Numbers is capable of exporting to a variety of different formats (each with the appropriate extension).
    Export in PDF, Excel, CSV, or Numbers ’09 file formats
    Choose File > Export To > [file format] (from the File menu at the top of your computer screen).
    Save a spreadsheet in another format
    http://help.apple.com/numbers/mac/3.2/#/tan886afc61b
    Cheers,
    Allen

  • Why does Illustrator make you save every file 20 times or more?

    OK I exaggerate, but really, saving 3-4 times over and over is quite annoying...

    Tom:
    What you are referring to is when you save a file for the first time. I used to think "what the hey?" until I figured out why it does what it does...
    When you go to save, you type in the file name, but without appending the extension, because you're used to the program doing this, right? Try typing the extension on the end and hit save, it will skip a step, adding the extension is all Illustrator does the first click.
    The second main dialog window gathers all the pertinent info you want to save with the file, so that is kinda important.
    What more do you want?

  • Mistakenly change file extension while in disk use mode

    I made the mistake of changing the file extension of a file on my Nano (5G) while it was in "disk use" mode. When I unplugged the device and later plugged it in, the modified file was gone. Does the Nano treat unrecognized files as non-existant? I tried using Windows Explorer to find the file, but nothing was there. Also, the overall memory used on the Nano has decreased by what I would guess is the same amount as the missing file. I'd like to get my file back. Any suggestions?

    Processing Raw in a 3rd Party Application
    You can also process your Raw with a 3rd Party app like ACR or Photoshop. But iPhoto does not handle this gracefully and it's a bit of a kludge.
    First off set your preferred app as an external editor in iPhoto:
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Note that iPhoto sends a copy+ of the file to Photoshop, so when you save be sure to use the Save command, not Save As... If you use Save As then you're creating a new file and iPhoto has no way of knowing about this new file. iPhoto is preserving your original anyway.
    Next: In the iPhoto Preferences -> Advanced, elect to use Raw with your External editor:
    Uploaded with plasq's Skitch!
    Now when you go to edit the Raw it will be sent to your external editor.
    Now for the kludge:
    You cannot save a Raw. The work you do must be output to a new file, in a new format (jepg, tiff, whatever). However, as the External Editor is making this new file iPhoto has no knowledge of its existence. Therefore you *must save it to the desktop and then import it back to iPhoto as a new file*.
    This means that you will have your Original Raw and the processed version in iPhoto but they will not be recognised as version and original. iPhoto will see them as two separate shots.

  • Download ZIP file without changing file extension

    I regularly download a zipped csv file, of the format: "filename.csv.gz". As the name does not change, Firefox adds a digit to distinguish it, so for example I get "filename.csv-3.gz". This is a pain as it changes the file extension which means that I cannot open the extracted file without first renaming it. I want to keep an archive of all the files, so deleting them each time isn't really an option, and neither is moving them to a different location each time. Is there any way the naming convention for downloads can be changed?

    I think you have to disable it in your Operating system:
    8dot3NameCreation
    [http://support.microsoft.com/kb/121007]

  • Change file extension in receiver file adapter

    File to File Scenario
    Posted: Sep 11, 2006 3:47 PM      Reply      E-mail this post 
    I am working on a File to File scenario.
    Source System gives out a file: abc ( with no extension)
    We need to archive it as: abc.done
    And we need to send it to a FTP server ( receiver File adapter) as abc.txt.
    How can I append a file extension when I archive and
    how can I change the file extension in the receiver File adapter?
    FYI, we are using XI as FTP server so I have created dummy message interface with no mapping.

    Hi,
    If I understood correctly once XI picks up the file it should be archieved as filename.doc and then it should be FTP'ed to a different location with a change in extension filename.txt.
    1. To Archive in the sender communication channel you can use OS Commands after prosessing (>=SP14) to rename the file and archive it. Suggested write a batch file which will rename the file and call the batch file from the OS Command of the sender file adapter. You can either use Archive functionaliy of the Sender adapter or you can write one more command in batch file to move the file to different folder. Make sure you are using fullpath while writing batch file.
    2. As said use dynamic configuration in a dummy mapping and then get the source file name and change the extension.
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Thanks,
    Prakash

  • Change document type without changing file extension

    I've recently started using Dreamweaver CS3 after nearly a decade on Homesite (which regrettably wouldn't work on my new Windows 7 machine). I like Dreamweaver's code view but find it lacking in some of the flexibility and intelligence that Homesite had.
    Case in point: I work on a rather large site that uses Classic ASP. Most of the site uses .html file extensions, but we have these configured to be processed through the ASP engine. When editing the pages on this site, Dreamweaver sees the .html file extension and assumes they're regular HTML documents, and color codes them accordingly, but it can't figure out ASP comments and code blocks and mangles the color coding. If I try to change the Document Type (in the Application > Server Behaviors panel), Dreamweaver insists on changing the file extension too.
    It appears I can modify Dreamweaver's MMDocumentTypes.xml file so that it thinks .html files are ASP. But I don't want to do this globally for ALL the sites I work on, only for this particular site. It would be really nice if I could change the document type definitions on a per-site basis, or to change the document type for a file without having to change the file extension. Surely I'm not the first person to use non-standard file extensions on webpages. Any ideas on how to fix this?

    I think you have to disable it in your Operating system:
    8dot3NameCreation
    [http://support.microsoft.com/kb/121007]

  • Changing file extension for Blu-Ray H264 export

    The output is written as .m4v, and my authoring tool will not accept this.
    It must be any of the following: m2v, m2p, mpg, mpeg, avc, 264, h264 bsf or vc1
    Can I simply change the extension - or is there a way to get the correct extension I need?
    (CinemaCraft allows you to define the extension used, for example)

    Any containering around the raw .264 video stream will screw up the embedded information.
    Non-Encore Bluray authoring tools will not accept any file format that is containering that stream.
    Also, if you want your bluray to be "legal" - ie be possible of passing a verification suite for pressing at a repro house - you have to export to raw .264 (thus why high end author tools won't import .m4v, mp4, mov etc).
    So, not you can't just change the extension. a m4v file is a ISO media container that holds a video stream... yes m4v, mp4 and mov are all based on the same standard - and yes you can thus change the file extension and it often works but......
    ... in this case you need a raw h.264 stream as a file (.264).
    The only thing I can think of is that you container it to MPEG-Transport Stream (MPEG-TS) with the file extension .mpg.
    It has the highest chance of import but I'm not sure if it destroys the h.264 stream's ability to pass BD verification.
    Note also that I've heard that the bundled H.264 encoder (made by Main Concept) does not have the mandatory "slice" support for AVC level 4.1 and higher so if you encode at that level it's already an illegal stream that you can guarantee will not play ok in every consumer blu-ray player.
    my 2c,
    Rallymax.

  • Changing file extensions disables any finder keyboard input

    Hi all,
    Well, i just said it. Oftentimes (very often) when I change a file extensions, after clicking yes to the most annoying confirmation dialog a web designer can find on OSX, the finder stops receiving any input from the keyboard.
    What happens is that after the extension change, I can select file names and do everything the mouse can do in the finder, but no keyboard input is received, I just cannot type any character whatsoever.
    Anyone with the same problem? A solution? A hint?
    I'm on Tiger 10.4.5, xtools2 installed.
    PowerBook G4 15'' 1GHz (512MB RAM)   Mac OS X (10.4.5)   iPod 3G (40GB), External FireWire HD (20GB)

    Have you tried trashing Finder prefs? Navigate to ~(yourhome)/library/preferences and trash these two files:
    com.apple.finder.plist
    com.apple.sidebarlists.plist
    Then log out and back in again. Or restart.
    (You will have to reset a few finder prefs the way you like them.)
    -mj
    [email protected]

  • Change File Extension

    Hi Experts
    I am pulling a .txt file from a location and dropping it to another location using file adapter. Is there a way I can change  the file extension .txt to .xml when I drop the file?

    Hi Skaria -
    Make sure you're not using the Adapter Specific Message Attributes (ASMA) option on your receiver file channel.   If you need to use it for something other than the file name attribute, you can still select the "Use Adapter Specific Message Attributes", but then unselect "File Name".
    However, if you need use the same file name as is picked up, but just with a different extension, you have to change ASMA filename in the message header (e.g. in a mapping).
    Regards,
    Jin

  • FileReference.save() loses file extension on Windows

    Hi all,
    I've run into an issue that I'm hoping someone has a workaround for. I'm using FileReference.save in a few places in my project. We ran into a bug today where the save operation loses the file extension under certain conditions. Those conditions are:
    The user is running on Windows and has hide file extensions turned on (the default)
    The user modifies the file name before saving.
    If the user has file extensions turned on or just saves without modifying the file name everything works fine.
    Does anyone know a workaround or fix for this problem?
    Thanks in advance!

    sorry Codeflayer, there's no way round it as far as i know (and ive tried, believe me)
    and its a feature, not a bug

Maybe you are looking for