Applescript Save As PNG without dialogs

Does anyone know how to force the dialogs that sometimes appear when applescripting a save as PNG to never ever appear? The Photoshop CS4 Applescript ref doc doesn't mention any options about this.
Thanks in advance,
- Alex Zavatone

Well, this is an old post, but maybe someone else needs the answer. Here's what worked for me:
set destinationfolder to "MyHardDrive:MyFolder:"
set currentFilepath to destinationfolder & "MyFileName.png"
set saveOptions to {class:PNG save options, interlaced:false}
save current document in file currentFilepath as PNG with options saveOptions appending no extension with copying
Applescript won't tell you if the destination folder doesn't exist. Instead, the save dialog box will pop up.

Similar Messages

  • How to save from .ai to .png without a gap

    I created a repeating pattern. I made the artboard the exact size of the art. I zoomed in and there are no gaps around the edge. I saved it for web and devices png8 and the top has a gap with transparency showing through. When I use it as a web page background, there is a white stripe showing. I've tried twice to resave it but get the same gap.
    I'm trying to upload the two images using the camera icon but nothing happens after I select the image and click the "insert image" button. Again, I've tried twice without a different result. Please advise.
    Thank you.
    Please help.
    Kathleen

    Having a hard time with google docs, sigh. Thank you for all your help.
    From: "Kurt Gold" <[email protected]>
    To: "kathpoole" <[email protected]>
    Sent: Tuesday, May 28, 2013 1:29:21 PM
    Subject: How to save from .ai to .png without a gap
         Re: How to save from .ai to .png without a gap
    created by Kurt Gold in Illustrator - View the full discussion
    Adobe Illustrator files are not tolerated as attachments in that Adobe Illustrator forum (great, isn't it?).
    You may take a service like Google Docs to provide them.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5359346#5359346
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5359346#5359346
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5359346#5359346. In the Actions box on the right, click the Stop Email Notifications link .
    Start a new discussion in Illustrator by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746 .

  • Creative cloud photoshop save as PNG

    Is there away to save a document from the creative cloud photoshop as a PNG? I am trying to use a graphic without the background for indesign.

    As long as you have transparency and turn off the visibilty or delete any other layers before saving as a png, it should save the transparency.
    Either File>Save As>PNG or File>Save For Web>PNG-24 (with Transparency checked in the save for web dialog)
    Indesign should also be able to use psd files.

  • Avoiding the 'Save PDF File As' dialog when printing to the adobe PDF printer from a service

    Hello, can someone please help.
    I have Adobe Acrobat 8 Pro installed.
    I have an in house application which (among many other things) effectively monitors a directory and prints the file to the default printer. It works fine when run as an application.
    I have set the defaults on the Adobe PDF printer to put the output PDF file into a directory and not to open it so it works silently without prompts.
    When I run my application as a service, it brings up the 'Save PDF File As' dialog and I would like to avoid this. My impression is that if I put the right registry key in then it will work.
    I do not want to do any scripting if I can avoid it.
    Thanks for all constructive help given.

    Thank for your help Bill, but changing settings in the distiller did not seem to work. As my application prints directly to the default application without using anything specific to Acrobat, I was hoping there was a simple way forward. A colleague suggested copying registry entries from the account I logged on as to the S-1-5-18 entry, then rebooting. This had no effect as the prompt still comes up.
    Aandi, I don't have the Acrobat SDK or any experience of it.
    Also I'm not sure where any code/script would sit since the application is stable and so I would rather not change it.
    If it amounts to a few lines of javascript sitting outside the application then that would be of interest.

  • Can't use Mac OS X save as PDF default dialog

    Hi,
    I am using Adobe Reader 9.1.0. I can't save a filled in PDF form to disk using the standard PDF option in Mac OS X default print dialog. Adobe pops up a message warning that "Can't save while printing, use Save As menu". I cant save the PDF form, and can't print it right here on a fisical printer.
    Thanks for your help.
    Mariano.

    Since you are not using Acrobat but you are not posting in the correct forum. You cannot save form data without having a specially enabled pdf file. Adobe doesn't seem to allow you to get around this restriction by saving via the Apple Pdf print mechanism.

  • Save As PNG script

    Hello,
    I'd like some help with this script if possible
    I wanted to save my open file to PNG format in the same location with the same name. I managed to do that with the scripts below.
    This is a script I found on the forum:
    #target photoshop
    main();
    function main(){
    if(!documents.length) return;
    try{
        var Path = decodeURI(activeDocument.path.parent);
        }catch(e){return;}
    if(!Folder(Path).exists){
        alert(Path + " Does not exist!");
        return;
    var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');
    var saveFile = File(Path + "/" + Name + "_bump.png");
    sfwPNG24(saveFile);
    //Uncomment the line below if you want to close the document.
    //app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    function sfwPNG24(saveFile){
    var pngOpts = new ExportOptionsSaveForWeb;
    pngOpts.format = SaveDocumentType.PNG
    pngOpts.PNG8 = false;
    pngOpts.transparency = true;
    pngOpts.interlaced = false;
    pngOpts.quality = 100;
    activeDocument.exportDocument(new File(saveFile),ExportType.SAVEFORWEB,pngOpts);
    And this is how I modified it (so that it saves the file in the same folder and doesn't add any suffix to the name; also changed to save as PNG instead of using save for web):
    #target photoshop
    main();
    function main(){
    if(!documents.length) return;
    try{
        var Path = decodeURI(activeDocument.path);
        }catch(e){return;}
    if(!Folder(Path).exists){
        alert(Path + " Does not exist!");
        return;
    var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');
    var saveFile = File(Path + "/" + Name + ".png");
    sfwPNG24(saveFile);
    //Uncomment the line below if you want to close the document.
    //app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    function sfwPNG24(saveFile){
    var pngOpts = new PNGSaveOptions;
    pngOpts.compression = 9;
    pngOpts.interlaced = false;
    activeDocument.saveAs(saveFile, pngOpts, true, Extension.LOWERCASE);
    [b]My problem:[/b]
    I don't know what's happening when I try to save a file just created (never saved yet). I thought I would get the Alert message but it doesn't seem to be the case (maybe the alert message in the code is related to a different condition?)
    I would like to have a default folder/path in the code so that, if the file hasn't been saved yet, it would be saved in the specified location.
    If anyone could do it I would really appreciate it!
    Thanks

    did not get that far.... Your catch ended the script without a notice to you. Try the changed line below in the catch.
    #target photoshop
    main();
    function main(){
    if(!documents.length) return;
    try{
        var Path = decodeURI(activeDocument.path);
        }catch(e){alert(e); return;}   //Let the user know about the problem
    if(!Folder(Path).exists){
        alert(Path + " Does not exist!");
        return;
    var Name = decodeURI(app.activeDocument.name).replace(/\.[^\.]+$/, '');
    var saveFile = File(Path + "/" + Name + ".png");
    sfwPNG24(saveFile);
    //Uncomment the line below if you want to close the document.
    //app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
    function sfwPNG24(saveFile){
    var pngOpts = new PNGSaveOptions;
    pngOpts.compression = 9;
    pngOpts.interlaced = false;
    activeDocument.saveAs(saveFile, pngOpts, true, Extension.LOWERCASE);

  • Save as png in different size and file name suffix.

    Maybe someone can help me on this Photoshop script. I am working on a psd file with few layers in Photoshop CS6. I would like to save it to the png format.
    Below is my workflow.
    1) Drag and drop 01.psd into Photoshop from A folder.
    2) Save 01.psd to 01.png into the A folder with different sizes and suffixes as shown below:
        - name: 01-xhires.png, size: 180x180
        - name: 01-hires.png, size: 90x90
        - name: 01.png, size: 45x45
    3) With png options: (I have no idea of some options below, but at least you know what I am lookng for. )
        - Compression: Smallest/Slow
        - Interlace: None
        - Transparency: True
        - Blur: 0:0
        - includeProfile = false
        - optimized = true
        - quality = 100
        - PNG8 = false
    4) Use lower case extension.
    5) Other options should be in default setting.
    The script should be able to:
    1) Overwrite the png files whenever the psd file has been updated and saved multiple times without prompting.
    2) Save the png files into the same folder as the source file without creating any subfolder.
    3) Not close the psd file, but still keeping it opens in the Photoshop without any changes.
    Please help, thank you very much.

    Goto Russell Browns web site download the Image Processor Pro script install it and use it to do what you want. However  the script will not overwrite files.   Overwriting file in an automated process is dangerous you could easily wipe out all you image if you make a mistake.  If you want to replace files create the new files in a new temp location then when you see the files are what you want. Move(cut) the files to the location you want replacing any files with the same name.
    Menu File>Automate>Image Processor Pro...
    source folder you psd files or open document which should stay open.  If you want the script to overwrite the output files you need to edit the script and remove the code that generate new name when output files exists. You may also need to change some save options.  I  would think you would want the profile you convert the image into stored in the png file,  Most of the otions you want can be set like same location no subfolders, 16bit  not interlace etc.

  • Save As PNG Adds Hard Transition to Gradient

    I have an image that I have created which includes a gradient with a soft transition from the light tone to the dark tone. When I save as PNG, the resulting image displays a hard transition to the gradient. How do I create a PNG image which maintains the subtlety of the gradient?

    Well, I found a setting in the Save for Web dialog where the gradient doesn't show as a smooth transition:
    But that's only in the Save for Web preview window -- using the browser preview button or saving the file shows a smooth transition....
    Ken

  • Since the CC update Document.saveAs() always opens a dialog

    Is anyone else seeing this?
    Is there a work around?
    This is a script I have been using for months to open Illustrator files in Phohoshop, resize them, and then save as PNG.   The source images are dynamically generated and it is impractical to sit around waiting to click on the save dialog after every one.   This is a new issue for a script I have been using for a long time.
    Photoshop 14.2 x64
    Extendscript Toolkit CC 4.0.0.1

    What version of Photoshop are you using and are you experiencing the same issue with Document.saveAs()?

  • Cannot save to PNG format ?

    Hi, (Photoshop CS5 newbie)
    I have been putting together a birthday cadr for someone and adding layer after layer with many his res images etc., I have saved the beast in the default PSD format and it weighs in at a massive 388,963 KB. Photoshop doesn't let me save in any other format, ie JPG or PNG, even after flattening the layers and reducing the image size.
    Q. Is there an threshold in terms of size that limits the output file type?
    Q. Please suggest a way forward so I can save as a JPG or PNG ?
    Many thanks..

    "Attempting"???  What do you mean "attempting"?  Just do it.  Well make a copy if you don't understand what you're doing, and convert the copy.
    The dialog box is telling you what you should already know.  Namely that "reducing the bit depth" (i.e. going from 32 bits to 8 bits) will affect the colors of layered images.  That's OK, because the PNG format does not support either layers nor 32 bits, so there's no other way of doing it.
    Yes, Merge the layers, and Convert to 8 bit.  Then Save as PNG or JPEG.

  • "create new layer without dialog"  redefine shortciut

    Hello.
    A want to redefine default shortcut for command "Create new layer without dialog" but i cannot find this command in shortcut preferences.
    In which section of shortcut preferences, in photoshop cs6, nested this command?
    Thanks.

    I don't believe that is a shortcut that can be redefined per se in the shortcut editor, but you could use a script and assign a keyboard shortcut to the script.
    The following script will make a new layer without the dialog.
    // =======================================================
    var idMk = charIDToTypeID( "Mk  " );
        var desc10 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref9 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            ref9.putClass( idLyr );
        desc10.putReference( idnull, ref9 );
    executeAction( idMk, desc10, DialogModes.NO );
    You can copy the above script, paste into Adobe ExtendScript Toolkit CS6 and then save the script to the cs6 Presets>Scripts folder in the photoshop cs6 program/application folder.
    (you can name it whatever you want as long as the extension is .jsx)
    Then when you restart photoshop cs6, it should be listed under File>Scripts and you can use the keyboard shortcut editor to assign a shortcut to the script.
    What operating system are you using?

  • How can I open a tdms file and replace a subset of data then save that change without re-writing the entire file again?

    Hi all,
    Is it possible to open a tdms file and make a small change an an array subset then save the file without having to save the whole dataset as a different file with a new name? That is to say, is there something similar to "Save" in MS Word rather than "Save As"... I only want to change a 1D array of four data points in a file of 7M data points.
    I am not sure if this make sense? Any help is apreciated.
    Thanks,
    Jack

    You can use either one, but for your application, I would use the synchronous.  It requires far less setup.  When you open the file, set both enable asynchronous and disable buffering to FALSE to enable you to use synchronous with arbitrary data sizes.
    Attached code is LabVIEW 2011.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    UpdateTDMS.zip ‏20 KB

  • Option help in Save for Web & Devices dialog

    When down sampling images for use in a DPS folio, what settings should be chosen in the Save for Web & Devices dialog in Photoshop?

    I need to figure out why my trim option is always grayed out. It's saved in PSD format, yet the option to trim the transparent pixels is grayed out. why is that? what am I doing wrong? I must have to change something.
    Thanks in advance, Linda

  • I have a keynote presentation that includes a significant amount of video.  When I edit the keynote slides (not the video slides) how can I save the changes without re-saving the videos (because that takes a VERY long time)?

    I have a keynote presentation that includes a significant amount of video.  When I edit the keynote slides (not the video slides) how can I save the changes without re-saving the videos (because that takes a VERY long time)?  I edit the presentation depending on the audience to which I am presenting.

    If you add a new  slide with just a text box (therefore a very small amount of data),  to an existing presentation then save,  Keynote will only save the new content to the file,  it wont save  pre-existing content as its already included in the file.
    The time  taken to "save" will be very much shorter than a "save as" when all of the existing content is saved again.

  • [SOLVED] GIMP is unable to save an PNG

    Hello,
    when I try to save an PNG within GIMP I get the following message:
    Saving '/home/alex/test.png' failed:
    Error while saving '/home/alex/test.png'. Could not save image.
    This is my commandline output:
    libpng error: known incorrect sRGB profile
    (file-png:5692): GLib-WARNING **: (gerror.c:390):g_error_new_valist: runtime check failed: (domain != 0)
    I reinstalled gimp and deleted my profile, but it didn't work.
    Does anyone have the same problem?
    Greetings
    Alex
    Last edited by oelfe (2013-05-28 13:08:55)

    I've been having the same problem for a while now, since the libpng update a couple of weeks ago.
    The day before the update, I was able to open a png, apply changes to compression, interlacing, etc., and export it to the same filename, overwriting the original. (Not the best workflow, I know)
    After the update, the export would just simply blank out (0KB) the original file and give the same error message.
    libpng error: known incorrect sRGB profile
    Here's an example of a png file that does not work - https://dl.dropboxusercontent.com/u/937 … rabian.png (107 KiB)
    My workaround was to convert the colour profile to Adobe RGB, open it in Gimp and convert it back(?) to sRGB.
    It doesn't seem to happen with every png though, just mostly the ones that I needed for actual work on a website (they are all from the same graphics guy).
    Last edited by adrianx (2013-05-27 21:22:42)

Maybe you are looking for