Trigger Save As... dialog with Javascript?

I have a script that makes some significant changes to an Illustrator file and would like to have a "Save As..." dialog pop up at the end of the script to give the user a chance to save the changes in a location of their choosing.
I know how to trigger a Save As dialog box with AppleScript using GUI scripting, is there a way of doing this with Javascript?

In short I think you answer is NO… There is no 'showing dialog' parameter in either language. You can prompt for a location pretty much the same as 'choose folder' in AppleScript. You can however construct your own dialog using ScriptUI and have the user input some options and a place to save. I am currently working on these myself for use my scripts… Here is an example of some for Photoshop…
First dialog offers a selection of File Format to use:
On choosing you get a second dialog (with limited options) for input:

Similar Messages

  • Open Save File Dialog with Default Path

    Hi All,
    I want to open a "Save File Dialog " with some default path.
    Like when user run that script I want to open  a "Save As" dialog box with default path "/Volumes/<shared name>/<folder name>/.. ."
    I am using
    File.SaveDialog(prompt, filter);
    but it doesn't open to the location by default that I want to open.
    Thanks
    Harsh

    look at this thread to see if it helps
    http://forums.adobe.com/thread/1077267?tstart=0

  • Open up "Save As" dialog in javascript

    Hello all,
         I am a newbie to scripting and to be honest it makes my head hurt lol, Kudos to all that make this look easy. I found some good resources but following everything is going to take a bit. I have am using the object model viewer and its a great resource. Long story even longer I am trying to automate a bunch of repetitive tasks that we have to run on a ton of pre-built documents. I have been hobbling together some code that has been working. everything is working and I can worry about cleaning up the code later (for my sake. I have OCD)
    I can't seem to find a way to open up the "save as" dialog so that the user can save the document to a directory that will change from week to week. The file name will vary across the run of files. I don't need anything to automate that part. I just want it to pop up and then continue the run. I'd like to do this at the start of the script so that when all the changes are made I can just have the document close. (I haven't included the closing code yet) Is this possible? I cant seem to find anything out there to point me in the right direction.
    Here is what I have so far.
    myDoc=app.activeDocument; 
    for (var  n=myDoc.masterSpreads.length-1; n>=0; n--){ 
         if (isMasterSpreadInUse(myDoc.masterSpreads[n])==false){ 
              myDoc.masterSpreads[n].remove(); 
    function isMasterSpreadInUse(myMasterSpread){ 
         var myDoc=myMasterSpread.parent; 
         for (var  n=myDoc.masterSpreads.length-1; n>=0; n--){ 
              if (myDoc.masterSpreads[n].appliedMaster==myMasterSpread){ 
                   return true; 
         for (var  n=myDoc.pages.length-1; n>=0; n--){ 
              if (myDoc.pages[n].appliedMaster==myMasterSpread){ 
                   return true; 
         return false; 
    Array.prototype.filter = function(collection) { 
              var k, i, con, ids = collection.everyItem().id; 
              con: for (k = ids.length - 1; k >=0; k--)  
                        for (i = 0; i < this.length; i++) 
                        if (this[i].id == ids[k]) { 
                             ids.splice(k, 1);  
                             continue con; 
              return ids;     // array with unmatched ids from collection 
    var  
              mL = app.activeDocument.pageItems.everyItem().itemLayer, 
              mUnusedLayersID = mL.filter(app.activeDocument.layers), 
              len = mUnusedLayersID.length; 
    while (len-->0) 
              app.activeDocument.layers.itemByID(mUnusedLayersID[len]).remove();
    var layers = app.activeDocument.layers.everyItem().getElements();
    for(var i=layers.length-1;i>=0;i--){
    if (layers[i].name[0] == "X"){
         layers[i].remove();
    app.documents.everyItem().xmlElements.item(0).xmlElements.everyItem().untag();
    myPreset = app.printerPresets.item("AdQ 8½x11");
    app.activeDocument.print(false, myPreset);
    SaveOptions.YES

    I've suddenly started getting this issue today on SSMS 2008 with Win 7.  I can do Save but as soon as I try Save As the whole thing just locks up.  I get a flashing Save icon in the bottom right corner but no Save dialog and all I can do at
    that point is close the whole thing down using Task Manager.
    Does anyone know if there is a fix for this?

  • Save File Dialog with PDF servlet

    I've looked through messages posted relavent to this topic but I'm having trouble finding a solution to my particular problem.
    I'm running a servlet that is used to dynamically generate completed business documents using given a customer number. The servlet loads the customer information, generates a collection of forms as a single pdf document and sends it back to the browser.
    The problem is, the servlet doesn't work in one of the scenarios that is required: we email a link to an adminstrator that clicks on the link to view the documents, e.g.:
    http://myhost/myservlet.srv?custno=1234
    When you click on the link in the email (using Outlook), you always get the "save/open file" dialog box. If you click cancel AND LEAVE THE BROWSER OPEN and click on the link again in the email, everything works fine--the pdf document opens up in Adobe. It's just when the OS has to launch a new browser window that it doesn't work and you get the dialog.
    I've tried using the content disposition header (both inline and attachment). I've tried setting the content length. I've tried adding no cache headers. Nothing seems to work for this particular use case.
    Anybody seen this before? I could really use a hint.

    There are two thing that u can do.
    First try setting the contenttype as text/html and see
    if it works. The reason its opening a download box is
    that the stream is coming as a .pdf header and browser
    is not getting a plug in for the same.
    another way is a bit patchy.
    you have to set some kind of parameter with your url
    that u send in e-mail.
    then depending on this parameter. first send a
    javascript to reload the page.
    something like.
    if (request.getParameter("isMail))
    //send
    javascript:document.location().substring(0,indexOf('&is
    ail');
    else
    //your normal processing
    this way browser will actually resubmit the request
    from browser itself and will resume your normal
    processing.
    Regards
    KuldeepThis is kind of what we finally did. We decided that rather than have the url point directly at the servlet, we had the link point at a jsp that simply digests the parameters and constructs a new url to the servlet and then sends a redirect to the browser to the new url.

  • How to avoid the "Save As" dialog when using "Close Button"

    Hello All,
    I am facing a problem while closing a pdf file.
    I am using the following code to Open a pdf file.
    CAcroApp objAcroApp = new AcroAppClass();
    CAcroAVDoc objAVDoc = new AcroAVDoc();
    objAVDoc.Open(C:\\new.pdf,Sample);
    objAcroApp.Show();
    After opening the document I am **** some changes (adding markup) in the file.
    Then I am closing the file using the Close Button and in YES for the save confirmation dialog.
    Here is the problem.
    After giving YES, I am getting a Save As dialog with "Sample.pdf" in the FileName box.
    I am getting this only in Acrobat 9.0.
    When I tried the same in Acrobat 8.0 I didnt get Save As dialog. It saved with out "Save As" dialog in "C:\\new.pdf".
    I need to give the same behavior in both Acrobat 9.0 and 8.0.
    Please help me out to fix this issue. Thanks in advance.
    Regards,
    Mohd Mustafa SK

    In what you have posted, there is no reason it shouldn't work the same way in Acrobat 9. I would recommend that you submit your complete application to developer support.

  • Export: In the Save as dialog, the file name is always shown as Crystalviewer instead of the report nameu00A0

    Post Author: sijdk
    CA Forum: Exporting
    hi,
    we are using crystal report server XI. in this i am not able  to export a report with particular report name. see the following steps.
    Generate a report. Click the Export icon.Select the format in which the report has to be stored and click Ok button
    Expected Behavior:The Save As form with the report name as file name should be displayed
    Actual BehaviorFile download window is displayed showing the name of report as crystalviewer.rpt and when Save button is clicked, the Save AS dialog with the filename as Crystalviewer is displayed.The user has to specify a meaningful report name

    Post Author: foghat
    CA Forum: Exporting
    This sounds about right, I can't recall if I've never seen Crystal default to the .rpt name when exporting a report.  In developer XI, reports saved on the enterprise server have some crazy long non-nonsensical unique identifier on export.  If the report is saved locally, it just gives untitled.xxx on export. That said, I find the users usually end up renaming the report file name anyways, so not a big issue.

  • In javascript how to invoke save as dialog box ,which saves .pdf files only

    Through javascript i generated a save as dialog box. the main problem is , it is only saving .html and .doc files by default. how to restrict it to save only .pdf files.
    the code i used is
    function SaveFile(fname)
    document.execCommand('SaveAs', null, fname)
    <input type="button" value ="save" onclick="SaveFile('');">
    /**********************************************************************/

    this is actually a Java forum its slightly different from javascript
    but try this not sure if it helps
    <input type="button" value ="save" onclick="SaveFile('.pdf');">

  • Always prompted with Save As Dialog when viewing dashboard

    Post Author: jgagarin
    CA Forum: Performance Management and Dashboards
    Hi,
      We are having problem viewing dashboard which contains Xcelsius document. In our development server we were able to view all dashboards with embedded Xcelsius document but when we move it to our production server it shows different output. Everytime we try to view the dashboard it keeps on prompting a "Save As Dialog" instead of showing the Xcelcius file. I really have no idea on what to do next, please help.
    Thanks,
    Jag

    Post Author: amr_foci
    CA Forum: Performance Management and Dashboards
    its an issue of macromedia flash player, if you already installed it on ur machine, remove it and reinstall the last version from the macromedia website thenrestart your mcahine.
    good luck

  • Open a save dialog with a name of a not existing file as tip name

    Hello, I`m using JFileChooser to save a file, but the file does not exist in the File System, it is only a Java File object.
    Then I want to open the dialog with a name for this new file already in the field, then I can change the folders and the proposed name will still be there to be used.
    I have found some posts pretty close to what I need but i could not solve my problem.
    Thanks

    setSelectedFile()

  • How to download  file with Save As dialog

    I am trying to download files with a Save As dialog, according to Jason Hunter's instructions in Jave Enterprise Best Practices.
    String filename = "content.txt";
    // set the headers
    res.setContentType( "application/x-download" );
    res.setHeader( "Content-Disposition", "attachment; filename=" + filename);
    // send the file
    OutputStream out = res.getOutputStream();
    returnFile( filename, out);
    The file content.txt is in the root directory of my webapp. But I get this stack:
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.io.FileNotFoundException: content.txt (The system cannot find the file specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.(FileInputStream.java:64)
         at com.interwoven.cssdk.examples.servlets.FileDownloadServlet.returnFile(FileDownloadServlet.java:43)
         at com.interwoven.cssdk.examples.servlets.FileDownloadServlet.doGet(FileDownloadServlet.java:24)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:484)

    The root of the webservers changes from server to server and
    sometimes it depends on the path you run webserver exe.
    The best i have found to overcome this kind of problems is by
    using getResourceAstream() method which basically looks at classpath locations only, but still this has some problems like it should kept at the
    specified classpath becoz the getResourceAsStrem() method is not static
    method and it always associated with the class object and the file
    accessing also should be in the same package/classpath.
    by using getResourceastream you cannot look at other places (except classpaths)
    and this should be used only if you looking for .properites definitions.
    the Second best method is
    see you have a file called "context.txt" right
    before you create a file, first create a directory at the root, let say
    "\tmp"
    and then create a file \tmp\context.txt
    and then open an output stream to it either using fileoutputstreamm...
    and then write all output content to servlet/client output stream.
    this will be the best becoz you are specifying the "\" the root
    and this is common for all operating systems and definitely it will create at the root directory either serverroot or harddiskdrives root
    so you will never missout and the exceptin will also not comes along the way
    cheers..
    if you get new thing , let me know
    bye
    with regards
    Lokesh T.C

  • Problem printing with Adobe Acrobat X pro. No File Save As dialog

    We have a C++ program to print a formatted report, by selecting the configured  printers. "Adobe PDF" printer is available on install of Adobe Acrobat Pro.
    During report print  when "Adobe PDF" printer is selected, the report use to get printed in a PDF document & saves at the path provided by the User.
    Internally it uses printer APIs like  OnBeginPrinting, StartDoc, OnPrepareDC, StartPage, OnPrepareDC etc.
    Report printing was working fine with Adobe Acrobat Pro 9.1. But since I installed Adobe Acrobat X pro (with update as 10.1.3) I am unable to print PDF document using "Adobe PDF" pinter.
    StartDoc API does not pops up the "File Save As" dialog at all.
    Any help in this regard, would be very useful.
    Note: My code is working fine, if I use freeware like CutePrinter.
    Thanks,
    Amit Agrawal

    Interesting. My approach would
    1. Try on a different system if available. If still bad...
    2. Try to create a simple test application with CreateDC and StartDoc, and really nothing else not absolutely needed.
    Test that.  If it is good, look for other problems in your application (e.g. memory overwrite).
    If your little example is still bad, post it here and other people can try and compare your results.

  • On a MBP with Mavericks how do I get the Save As dialog box to open at the same size and place at which it was last closed and used to happen before Mavericks?

    Before I upgraded my MBP to Mavericks, the Save As dialog box would reopen at the same size and position as it was when last closed.  Now with Mavericks it always opens in the same position at a very small size.  Is there a way to make it reopen at the last place and size at which it was closed?

    I have resolved the issues presented without having to find and uninstall the Macromedia Flash Player 8.0 in order to get "Adobe Flash Player 10" playback of .swf files on my computer. When I begin this task, I expected to download an "Adobe Flash Player 10" as a player program download instead of the Internet Explorer and Firefox plugin that it appears to be.
    This is what I did and what I believe I have:
    1. I setup Internet Explorer 6 as my default browser and then used the following site to download Adobe Flash Player 10
    http://www.adobe.com/products/flashplayer/
    2. As I had done before (and also suggested in another thread here), I went to Tools/Manage Add Ons and found Shockwave Flash Object, highlighted it, and clicked on Update Active X. Next, what I did not do before, I restarted the computer immediately after that.
    3. Next, I set Mozilla Firefox as my default browser and then used the above site to download Adobe Flash Player 10 again.
    4. With Firefox, the critical step included Firefox Tools/Options/Content with File Types (Configure how Firefox handles certain types of files) and the Manage Tab there. SWF Shockware Flash Object/Change Action/and dotting "use this plugin" - Shockwave Flash, followed by a computer restart got the job done.
    Now, if I want playback of a .swf file, I can
    a. Open With Internet Explorer (assumed with the Adobe Flash 10 "plugin")
    b. Open With Mozilla Firefox (assumed with the Adobe Flash 10 "plugin")
    c. Open With Macromedia Flash Player 8.0
    I am satisfied with those results for my use. Any additional comments on the player vs plugin aspect of the matter would be interesting and helpful.
    ATR

  • How avoid of dialog in MS Word 97 during Save As HTML with JACOB...

    How to avoid of dialog "Microsoft HTML Conversion" in MS Word 97 during Save As HTML with JACOB. Dialog has this type of content: This document contains characters that are not in the current language encoding. To preserve them, choose cancel and select the appropriate language encoding. For multilingual documents, use UTF-8.

    It's not a JACOB issue, probably you have to direct your question to some Microsoft newsgroup (about Microsoft Word 97 automation using OLE/COM)

  • Save dialog with file type selection

    I'd like to give the user a save dialog with a dropdown
    showing a list of file formats to select from, as is pretty much
    always the case in normal save dialogs (even if there's only one
    acceptable file type.) It servers both as giving the user options
    and letting the user know the file format being saved to.
    I can't seem to figure out how to do that in AIR.
    File.browseForSave does not take a FileFilter array, and does not
    provide a default name option. I can get the default name by
    resolving a path for the File object first, but this doesn't show
    the user the various filetype options they have, and even if they
    knew them they would have to manually type them in the dialog. Am I
    missing something?

    FOUND THE PROBLEM!
    I have several timelines in the project, and most of them are titled things like "window dub w/timecode". I found one that was titled "interviews" and tried to render that. The Save dialog appeared, only when I rendered from THAT timeline. So I started to look for differences between the timelines.. then it dawned on me that all the timelines that don't render have the "/" character in the title. Adobe should warn that this character is not allowed, rather than allow it and then behave weirdly. Could have saved me hours of thrashing about!

  • Media Encoder, No File Save Dialog with New XDCam Project

    I've started a new project last night and I got it edited toda
    y. It's XDCam 24P timelines, very simple linear
    string of short 45 second clips of interviews with executives.
    The timeline behaves normally in every respect. Except, when I attempt to render it to any format in Media Encoder, I never get the File Save As dialog. I press OK and the Media Encoder settings goes away, then, a second later, reappears. It took me a few moments to realize something was wrong.
    I rebooted the computer, thinking Premiere was just corrupt in memory, as sometimes happens, but after a fresh start, the same behavior with the Media Encoder. Now I'm really worried, because this is a corporate event video with a deadline.
    Just to check, I tried opening a prior project and tried to render anything in that project. This time I get the Save As dialog, which is expected. So I return to the corporate event project and try again to render anything within that project. The encoder settings keeps redrawing when I press OK and I cannot save anything.
    Thinking my project was corrupted, I copied the assets and made a new project and pasted them into the new, blank project. Once again, I cannot render anything. All I get is a redraw out of the Media Encoder settings screen.
    This is a very simple project. There is nothing unusual about it that could cause this freakish behavior, except the lighting used at the event was mostly yellow. Apparently it doesn't like something about my footage, but I cannot re-shoot this one-time corporate event! If a reboot didn't fix it, and other projects still work normally, then it's a real head-scratcher. This is new behavior that I've not encountered in 3 years of using CS3.
    I'm out of ideas. If it's XDCam my footage, then I'm dead in the water here!

    FOUND THE PROBLEM!
    I have several timelines in the project, and most of them are titled things like "window dub w/timecode". I found one that was titled "interviews" and tried to render that. The Save dialog appeared, only when I rendered from THAT timeline. So I started to look for differences between the timelines.. then it dawned on me that all the timelines that don't render have the "/" character in the title. Adobe should warn that this character is not allowed, rather than allow it and then behave weirdly. Could have saved me hours of thrashing about!

Maybe you are looking for

  • Mail and iPhoto ... Photos always get sent small

    Emailing from iPhoto using Mail ... I have a problem in that when I want to email or share photos ... despite choosing to send actual sized photos ... eg 1.8Mb for 3 photos ... when I go to compose and then send, they only get sent as small 30k image

  • Font Book: Managing Fonts, Duplicates, Warnings etc... Need Help!

    How this all started... I have a lot of fonts. I use them for design purposes, and recently added a bunch of new ones. As a result, I had a problem with an Adobe program and the font displayed in the workspace. I figured out which one caused it and d

  • Needed doc for PO creation

    hi all, can anyone give me steps for creating PO or screen shots. i need it urgently. i am new to this. i will award ur efforts. thanks sanjeev

  • Authorisation - Inputschedule

    Hello, Have a specific issue with accessing the input schedules with in our user group one can access the worksheet with in the template and one cannot. The access rights / authorisation has been given at the same level, I have deleted and recreated

  • After stopping replication what happens to the table for which we have stopped replication

    Hello Team                     Once we stop a replication for a table then does the table still exists in HANA DB . Next time when we have requirement for replicating this table what precautions we need to take . Regards