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?

Similar Messages

  • Solution for Slow Open and Save As Dialogs under 10.4.4

    I don't know how many others out there may be experiencing this, but...
    I noticed that -- after updating to 10.4.4 -- I started getting really long delays when accessing Open and Save As file dialogs -- I mean, sometimes it would take 5 to 15 seconds for the dialog to appear!
    I did a lot of troubleshooting, and finally hit upon the solution a couple of nights ago:
    It's the Desktop iDisk!
    Going into the .Mac Preference Pane and turning off "iDisk Syncing" has totally eliminated the slowdown.
    I think it has something to do with DiskMirrorAgent, since that has frozen on me a couple of times and prevented logoff until I force-quit it.
    'Hope this helps.
    -- Steve
    Late 2005 DC G5 2.3 GHz, 4 GB RAM   Mac OS X (10.4.4)  

    Hi Matt,
    One can always manually mount the iDisk when needed, and it still syncs, albeit in real time, and kind of herky-jerky.
    As for the slowdown when multiple items are mounted, I believe I'm describing a different issue, related to DiskMirrorAgent. If and when you get this slowdown (with desktop iDisk syncing enabled), check Activity Monitor, and you'll see DiskMirrrorAgent sucking up most of the CPU time for the time it takes before the dialog appears. My record time was about 25 seconds.
    As for slow Open and Save As dialogs when multiple items are mounted: I customarily have several external FireWire drives mounted, and often a couple of CDs and/or DVDs (I produce a radio program, and have several optical drives), and I have had no Open or Save As dialog slowdowns since at least 10.3.x, maybe earlier.
    Even when the dialog opens to a directory on a CD that has spun down, the opening time on an Open or Save As dialog is nearly instantaneous for me, suggesting that Mac OS X 10.4.x is doing a good job of caching the data.
    But I hear you about the "old days," when it used to take forever to get a dialog to appear, just because a CD was mounted! Maddening!
    -- Steve
    Late 2005 DC G5 2.3 GHz, 4 GB RAM   Mac OS X (10.4.4)  

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • How to open a save file dialog box in form

    hi
    all
    I have prob in form desing , i have open the save file dialog box , how to open a save dialog box
    and path of the select file to save in disk
    help
    thx

    hi
    user this query when-button-pressed trigger
    :txtfile := GET_FILE_NAME(directory_name =>'d:\ali_raza\backup\', file_filter=> 'DMP Files (*.dmp)|*.dmp|');
    Rizwan

  • How to open a 'Save As' Dialog box in JSP?

    Hi all, i need to export a CSV file. A button is provided to the user to choose the directory to save the file. My problem is how to open a 'Save As' dialog box in JSP?
    Thanks in advance

    Hi,
    Below is my full code to download fiel but still the Save Dialog box still not show..
    <%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"
    %><%@ taglib prefix="asset" uri="futuretense_cs/asset.tld"
    %><%@ taglib prefix="assetset" uri="futuretense_cs/assetset.tld"
    %><%@ taglib prefix="commercecontext" uri="futuretense_cs/commercecontext.tld"
    %><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"
    %><%@ taglib prefix="listobject" uri="futuretense_cs/listobject.tld"
    %><%@ taglib prefix="render" uri="futuretense_cs/render.tld"
    %><%@ taglib prefix="siteplan" uri="futuretense_cs/siteplan.tld"
    %><%@ taglib prefix="searchstate" uri="futuretense_cs/searchstate.tld"
    %><%@ taglib prefix="locale" uri="futuretense_cs/locale1.tld"
    %><%@ taglib prefix="dateformat" uri="futuretense_cs/dateformat.tld"
    %><%@ taglib prefix="blobservice" uri="futuretense_cs/blobservice.tld"
    %><%@ taglib prefix="satellite" uri="futuretense_cs/satellite.tld"     
    %><%@ taglib prefix="date" uri="futuretense_cs/date.tld"
    %><%@ page import="COM.FutureTense.Interfaces.*,
    COM.FutureTense.Util.ftMessage,
    COM.FutureTense.Util.ftErrors"
    %><%@ page import="COM.FutureTense.Interfaces.*,
    COM.FutureTense.Util.ftMessage,
    COM.FutureTense.Util.ftErrors"
    %>
    <%@ page language="java" contentType="text/html;charset=UTF-8" %>
    <%@ page import="java.io.File" %>
    <%@ page import="java.io.OutputStream" %>
    <%@ page import="java.io.FileInputStream" %>
    <cs:ftcs><%-- france/test_template
    INPUT
    OUTPUT
    --%>
    <%-- Record dependencies for the Template --%>
    <ics:if condition='<%=ics.GetVar("tid")!=null%>'><ics:then><render:logdep cid='<%=ics.GetVar("tid")%>' c="Template"/></ics:then></ics:if>
    <%
    String fileToFind = request.getParameter("file");
    if(fileToFind == null) return;
    File fname = new File(fileToFind);
    System.out.println("Save As: "+fname.getName() );
    if(!fname.exists()) return;
    FileInputStream istr = null;
    response.setContentType("application/octet-stream;charset=ISO-8859-1");
    response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
    try {
    istr = new FileInputStream(fname);
    int curByte=-1;
    while( (curByte=istr.read()) !=-1){
    out.write(curByte);
    out.flush();
    } catch(Exception ex){
    ex.printStackTrace(System.out);
    } finally{
    try {
    if(istr!=null) istr.close();
    } catch(Exception ex){
    System.out.println("Major Error Releasing Streams: "+ex.toString());
    try {
    response.flushBuffer();
    } catch(Exception ex){
    System.out.println("Error flushing the Response: "+ex.toString());
    %>
    </cs:ftcs>
    Can anybody help me with this???
    Thank you in advance.

  • Move, delete, or rename files in Open or Save As Dialog box

    I want to be able to rename, delete or move a file when I am in an Open or Save As dialog box. Sometimes when I am opening a file or saving a new file I spot an existing file that needs to be renamed, moved to a folder or even deleted. In Windows I would just take care of that file and then keep going with what I was doing in the first place. This doesn't seem to work in Mac OSX. I have to stop, go to a Finder window, go to the location, do what I want to do to the file and then go back to the Open or Save As dialog box. There's go to be a better way in the "world's most advanced operating system." Ideas?

    SDA_MAC wrote:
    There's go to be a better way in the "world's most advanced operating system."
    no, there isn't.
    Ideas?
    you can ask apple to implement this feature
    http://www.apple.com/feedback/macosx.html

  • All Office 2010 Applications Slow To Produce "OPEN" or "SAVE AS" Dialog Box ONLY When PC Connected To Network

    Hello all,
    Frustrating problem: ALL Office 2010 apps require a 45 second delay to produce an "open" or "save as" dialog box when the computer is connected to a LAN (wireless or wired, domain or workgroup). When the computer is NOT connected to a LAN (wireless or wired,
    domain or workgroup), then Office 2010 "open" or "save as" dialog boxes open normally (and quickly).
    I suspect a network search/survey function internal to MS Office is at fault.
    This is NOT the infamous mapped network drive problem associated with Office 2007/2010. There are no mapped drives (nor have there ever been) on the PC, although there might exist a related solution. Additionally, there is no 45 second delay when opening
    a file by double-clicking on the file itself which will launch the application.
    Other information:
    1. PC runs Windows 7 Pro 32 bit - PC is a relatively new Lenovo T400 laptop, all updates from Lenovo and MS installed, running clean and nicely otherwise, no spyware, no viruses, no previous software or hardware issues requiring assistance. Event log is
    clean.
    2. Absolutely fresh installation of Office 2010 Pro Plus (MS Action Pack)
    3. Running Office apps in safe mode does not alter problem behavior (ie, "windword.exe /a" or use CTRL key and double-click to launch app)
    4. Running Windows 7 in safe mode with networking and then subsequently testing Office apps is not possible: "license not able to validate" issue. This is a known problem and is not related to the slow dialog box response behavior.
    5. A desktop PC with the same MS Office 2010 installation, same volume license key, on the same network does NOT produce this problem.
    6. Full uninstall, reboot, and re-install of Office 2010 does not alleviate problem
    7. Disabling ALL startup items and services (including, of course, ALL Lenovo management software) does not alleviate problem
    8. SMB v2 bug is not the problem: ie, disabling mrxsmb20 service does not alleviate symptoms.
    9. I have isolated "Client for Microsoft Networks", "QOS Packet Scheduler", "Link-Layer Topology Discovery Mapper I/O Driver" (and Responder), and "Printer and File Sharing for MS Networks" in the network adapter properties are NOT causing the issue.
    10. Using Sysinternals Registry Monitor, I was able to determine that Office apps evaluate certain properties of your Internet Explorer settings before attempting to launch the "open" or "save as" dialog box. Altering the way intranets are detected, for
    example, does not alleviate the symptoms.
    11. Turning off Antivirus software (Avira Personal) does not alleviate the issue.
    This issue is causing a huge loss of work efficiency. Any help would be greatly appreciated.
    Thank you for your time.
    Sincerely,
    Rick

    Hello Rick,
    Through all the research I have done so far and talking with a few other coworkers what the common issues that cause this are is:
    1. Antivirus: disabling the antivirus is not good enough it needs to be totaly uninstalled and retested.
    2. startup programs: these need to be disabled through either Safe mode with networking or the start menu or MSconfig.
    3. Office addins: Disable all of them see if that helps. Then turn them back on one by one to see which addin is causing the issue.
    To disable addins: 1. open up regedit and navigate to this key. HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Addins and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins
    Then change the LoadBehavior to 0 this will disable the addin. 3 lets it run. Since this affected only one user HKEY_LOCAL_USER might be your best bet but don't rule out the other location.
    To verify there are no addins running go to the File tab>options>Add-Ins make sure nothing is listed under Active Application Add-ins.
    I hope this helps
    Thanks,
    Paul Slaathaug Sr. Support Engineer - Microsoft Word

  • Click a Link and open the save-as dialog box instead of browser opening it

    Basically, i have a link to an image and when i click it the browser opens the image. I would prefer that when i click the link to the image that i get some sort of save functionality to occur.
    I created a link to the Google logo so it looks like Google image when clicked the browser opens the image. What i would like to do is click the link and then have the save-as dialog pop up (or something similar). Currently I would either have to right click the opened image and save image as or right click the link and then save-as that way. In this instance the file doesn't reside on the database but an external source so is there a way to save-as dialog once the link is clicked?

    Sorry, I have no idea what you are doing; can you give us some details?

  • Windows 7 Open and Save As dialog box gives an "Access Denied" when using common Windows Explorer features.

    On many computers in our environment we have issues in Windows 7 when using the Common Dialog Box.  Within the dialog box we get the error Access Denied whenever we try to create a folder.  If we try to rename a file it doesn't give an error but
    it doesn't work either.  We cannot delete a file, still no error, but we can create shortcut.
    Within Windows Explorer of the same user it has no issues.
    Even if we run an application as administrator it has the same results.
    Example: Open Paint (right click "Run As Administrator"); then File, "Save As", right-click in empty space; then New, Folder.  This caused the error to popup "Unable to create the folder 'New folder'  Access is denied."
    Thanks for your help,
    Daniel

    Hi Daniel,
    How are things going? As the article provided above said, for such kind of issues generally it is caused by permission settings.
    The article provided several possible solution and please let us know if there is anything unclear about the steps. 
    If you have any feedback on our support, please send to [email protected]

  • Drive restriction group policy causes error message when accessing Open and Save As Dialog Boxes on Windows 8.1

    We are running Windows 8.1 Pro x86
    I am really curious as to why the drive restriction group policy causes the error message to pop up:
    "This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator."
    It does not prevent from actual saving so functionality is not lost but it really annoys our end users and we're getting a lot of complaints. We cannot use the workaround of hiding drives instead of restricting as this still presents security issues. This
    is happens when saving (or clicking on a button like "Browse" that opens the 'Open' dialogue box) in all Office 2013 applications, Internet Explorer, Paint, Notepad, and probably most others. I've looked at many forums and no suggestions for workarounds
    have succeeded for us to get rid of this error message and in fact, I read a post that stated that someone contacted Microsoft and they said this was by design and there is no workaround. I find this very unfortunate that we either have the choice of compromising
    security or annoying our end users. It seems to me like the new dialogue box in Windows 8.1 (and maybe 8?) attempts to access the local drive under the logged in user's account before it actually opens up the dialogue box which conflicts with the group policy
    that restricts access to the drive.
    Has anyone at all had any luck getting this to go away without removing the restrictions? It seems like the answer is either buried in the Windows code or somewhere in the registry.
    Thank you in advance for your time!

    Thank you for your time and response! Unfortunately, we have the machine locked down pretty tight (they are public use computers that require heavy restriction) and it is set to restrict all drives so access is limited to the local profile. We did try
    testing your method, however, by adding the Desktop as an allowed location in the Office policy (which would not solve the issue for the other applications but was good for a test) using the path %userprofile%\desktop. When choosing that location, it does
    not throw the error but unfortunately, it does not remember like it did for your with the E: drive so it still always throws the error when first loading the dialogue box no matter what I do. If you're able to confirm that this is simply by design and we're
    just expected to inform our users to click through the errors, then I guess that's the accepted answer. Although, do you think that there might be a registry key value that is set after you save to the E: drive for the first time? Maybe we could set that value
    to %userprofile%\desktop if it's doing the redirection after the first save through registry. Thanks again!

  • Save As Dialog Not Showing when opening pdf from Outlook 2010

    Hi
    I have recently had to change the default documents folder on a windows 7 machine (Right Click Documents, properties,  include folder, set save location). Since this change, when opening an attached pdf document in outlook 2010 and viewing with adobe reader, if i click Save as from the file menu, no os dialog appears and therefore user cannot choose a place to save the document.
    As a work around the user can right click the attachment save the docment to a location, once opened, ther save as dialog is usable.
    I have uninstalled and re-installed reader to the laterst version, but with no luck.
    Any ideas?
    Jason Congerton

    This looks like a new behavior of Outlook 2010 and isn't specific to PDFs. You will need to "save as" the document. There is a thread at Microsoft forums about this with some possible workarounds:
    http://social.technet.microsoft.com/Forums/en-US/outlook/thread/927d678d-b55b-4732-93cb-f1 3ed1dacf96/

  • How to open a Save Dialog in JSP?

    Hi all, i need to export a CSV file. A button is provided to the user to choose where to save the file. My problem is how to open a 'Save As' dialog box in JSP?

    Hi all, i need to export a CSV file. A button is provided to the user to choose where to save the file. My problem is how to open a 'Save As' dialog box in JSP?

  • CS5.5/OS X 10.8: Open/Save As dialog box resizing

    Since I have been using CS5.5 Web Design Premium in Mountain Lion, I cannot get the programs to remember me resizing the Open and Save As dialog boxes.
    Each time I Open or Save As, the windows default to about 720 x 540, which is annoyingly small on a 1920 x 1200 screen. 
    In each programs' .plist file, located at /Users/(username)/Library/Preferences/, there are two keys:
    NSNavPanelExpandedSizeForOpenMode:GetFile
    NSNavPanelExpandedSizeForSaveMode:PutFile
    After trying to resize the windows, I  QuickLook these .plist files.  The values for these key-value pairs are
    1)  sporadically updated and subsequently ignored on program close/relaunch, or
    2)  not updated at all.
    Have noticed this problem in DW, FW, AI, and FL.  PS seems to be the only exception.
    Adobe products are the only programs on my Mac that exhibit this problem.
    Mac OS is up to date. (10.8.3 as of date of post)
    All aforementioned Adobe programs are up to date according to the Adobe Application Manager.
    The preferences folder and the specific .plist files contained therein are read/writeable by me, the administrator.
    Rebuilding the .plist file does not help.
    Rebuilding the Saved Application State folder for the program does not help.
    Other miscellaneous things (resizing Finder columns, showing/rehiding hidden files, maximizing/restoring the window) don't help either.
    Can any community members who have experienced this problem suggest any fixes?

    I think this is an OS X 10.8 thing rather than a CS5.5/OS X 10.8 thing – but I would really like a fix for this too, nnotnorth

  • Photoshop CS6 Windows - Open\Save as dialog box

    Why in Photoshop & Illustrator CS6 "Open" and "Save as" dialog box style is from Windows XP?
    In AfterEffects, Audition and other is new dialog box style:
    Can Adobe add in "Preferences" - option with checkbox for users Windows 7/8
    who can use the new windows explorer with extended folder bar?
    That would be simplified and speeded up a lot of things.
    Or maybe I'm blind and not see this option

    Summary:
    ... because 100 years ago, people also had wooden wheels for cars.

  • 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

Maybe you are looking for

  • NUMERO DE NOTA FISCAL

    Bom dia pessoal, Tudo bem? Estou com um problema, o seguinte, tenho um processo normal de vendas, crio a ordem, remessa, e documento de faturamento, por ultimo gero a nota fiscal e impressão, mas não esta gerando o numero da nota fiscal, o campo nume

  • Help Itunes not playing songs, slow to load

    I'm running windows xp on a laptop, and itunes. It is the current version downloaded from mac. The problem is takes about 4 min to actually open itunes. When it finally does, it won't play any songs. I've tried reinstalling it, and tried deleting/upd

  • Help!  Is DDM the tool for me ?

    I'm stepping into two large and complex databases with many tables and much linkage. (running over Oracle 10) I'm going to be implementing multiple sites with clones of these databases - but each site will have a subset of the total data. The data is

  • Best way to copy FCP-created Blu-ray Disc?

    Tried using FCP7 to burn another copy of a Blu-ray disc a week after I burned the first copy. But since I didn't want to wait 16 hours for FCP to encode the Blu-ray files again, I copied the files off the first Blu-ray Disc I'd burned onto my desktop

  • Versatile editor for multi-platform word game

    Hi My 1st here. Will Flex do? WL Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Detect language Dutch English Estonian Filipino Finnish French Galici