Save As Using JavaScript

Hello everyone,
I cant figure out the javascript to have a button do a save as and use content from a field as the new file name. Can anyone help me with this?

It worked, thank you!
Now, do you know if there is a way to make this work with an ipad?
My ultimate goal is to create a workorder form that I can access from my ipad. I already have a button set up to generate a unique work order number. I have used the code from the post you provided to have a button do a save as and use the work order number as the file name. So everything is working exactly how I want it on my computer but I would like the same functionality on my ipad.
Please let me know if you have any suggestions. Thanks!

Similar Messages

  • How do I save preferences/values using javascript in dashboard widget?

    How do I save preferences/values using javascript in dashboard widget? I apologize if this is a stupid question but I simply cant seem to find a way. For example, if on teh back side of the widget teh user chooses the color of the widget, where or how do I save that value so it is retained the next time the user goes to the dashboard. Also, once saved, how do I read the value?
    Thanks a mil....

    Please look into
    /Developer/Examples/Dashboard/Goodbye World/3-Saving Preferences directory for a comple example.
    Otherwise, wait until the following book is published :-))
    http://www.apress.com/book/bookDisplay.html?bID=10173
    Mihalis.

  • Save as option using javascript

    Hi Experts,
    I am try to write code for "save as" option using javascript.
    could you please help me........

    There is no saveas function in indesign javascript, use save function instead,
    var myFolder = new Folder("~/Desktop/Your_Folder");
    app.activeDocument.save(myFolder.fsName + "\\" + "myIndesignFile.indd");
    Vandy

  • Possible to save files in My Documents using JavaScript?

    I have a customer who wants his users (service technicians) to be prompted to save a PDF form they fill out, print, and sign for their customers. It's easy to set the File>Save As action for the form button, but my customer wants to know if it's possible to always have the form saved to My Documents.
    I've searched the form and haven't been able to find any discussion on this. I can't imagine how to do it, since My Documents is inside the user profile... but was wondering what people who actually know what they're talking about (as opposed to me, that is) might have to say.
    If it is possible to do what my customer wants, can you point me to any existing code or reference sources?
    Cheers!
    ---Fox

    But I have two problems with this...
    The first is that I ran several Google site-searches and Adobe searches, but did not find any document*** named Acrobat JavaScript API Reference, even though it is also directly referenced in the Acrobat 9 help (listed there as JavaScript™ for Acrobat® API Reference, but I've searched using broader terms such as API reference and other combinations, and it simply did not come up).
    I did find the companion "Developing Acrobat® Applications Using JavaScript". But it's overwhelming, and I don't know what chapter(s) contain the information I need to throw together a proper working script for what I need.
    That's the other problem.
    I do not know JavaScript. I know how to include it but not how to write it. Everywhere I look, the blanket response to newbie JavaScript questions is to dump the wad of documentation in the asker's lap, expecting them to sit down and read it "cover to cover."  I now have a long-overdue project and I need help, fast. I don't have time to learn JavaScript from scratch! -- If I did, I wouldn't be asking these questions! I'd be figuring it out myself.
    This is becoming very frustrating. Won't somebody please help me out, or tell me exactly what pieces of code I need to put in and where I need to put it?  I can at least go look up the syntax, as long as I know what to look for.
    EDIT:  *** Now that I've written that, I ran the Adobe search tool again and found the PDF version, which is what I was looking for. The saveAs samples make no sense to me, and I keep trying to dig back through the documentation to figure out what the heck it's talking about. It's a quagmire. The documentation is barely understandable; it's very poorly worded, and every sentence is thick with unfamiliar concepts for a n00b -- and I'm a tech writer!
    Message was edited by: FoxCole

  • Open/save dialog box using javascript.

    Hi,
    working on apex4.1
    How i can display open / save dialog box when click on button or link using javascript.
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 27, 2013 10:20 PM

    Hi,
    I am using model dialog box.
    on page header i have copy The code as given in this http://jqueryui.com/dialog/#modal-message link
    //  page header code
    <!doctype html> <html lang="en"><head>  <meta charset="utf-8" />  <title>jQuery UI Dialog - Modal message</title>  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />  <script src="http://code.jquery.com/jquery-1.8.3.js"></script>  <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>  <link rel="stylesheet" href="/resources/demos/style.css" />  <script>  $(function() {    $( "#dialog-message" ).dialog({      modal: true,      buttons: {        Ok: function() {          $( this ).dialog( "close" );        }      }    });  });  </script></head><body> <div id="dialog-message" title="Download complete">  <p>    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>    Your files have downloaded successfully into the My Downloads folder.  </p>  <p>    Currently using <b>36% of your storage space</b>.  </p></div> <p>Sed vel diam id libero <a href="http://example.com">rutrum convallis</a>. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.</p>  </body></html> My Button name is "DOWNLOAD" and on button actions "REDIRECT TO URL"
    on URL TARGET value is ==javascript: myFunction();
    where i have to write this code to bind my apex buttons with dialog box.
    apex.submit(myRequest);the steps i have written above, am doing right or not? Please help to place the code in apex with a right way.
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 28, 2013 12:53 AM

  • How can I pass variables from one project to another using Javascript?

    Hi all, I am trying to do this: let learners take one course and finish a quiz. Then based on their quiz scores, they will be sent to other differenct courses.
    However, I wish keep track on their previous quiz scores as well as many other variables.
    I found this nice widge of upload/download variables by CPguru (http://www.cpguru.com/2011/05/18/save-and-load-data-widget-for-adobe-captivate-4-and-adobe -captivate-5/). However, this widget works by storing variables from one project in local computer and then upload it to another project.
    My targeted learners may not always use the same computer though, so using this widget seems not work.
    All these courses resided in a local-made LMS which I don't have access to their code. Therefore, passing variables to PHP html files seems not work.
    Based on my limited programing knowledge, I assume that using Javascript to pass variables may be the only possible way.
    Can someone instruct me how to do this?
    Thank you very much.

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • Using Javascript to rasterize a layer and maintain its position with other layers.

    Trying to use javascript to rasterize just the contents of a certain layer by its name.
    It needs to maintain its position.
    I've sort of cobbled a script, but it keeps moving the rastered art to the top layer.
    Ex, top down i have Layer 4, RasterizeMe, Layer 2, Layer 1. 
    The rastered contents end up on Layer 4
    Any help would be apprecieated, or if theres a better method of doing this.
    //  Rasterize Layer by name
        if ( app.documents.length > 0 ) {
            doc = app.activeDocument;
            if(!doc.saved){
                Window.alert("This script needs to modify your document. Please save it before running this script.");
            }else{
                createRasterLayer(doc);
        }else{
            Window.alert("You must open at least one document.");
    function createRasterLayer(doc){
        var totalLayers = doc.layers.length;  //get the total number of layers in the active document
        for ( var i = 0 ; i < totalLayers ; i++){  //looping through layers            
            var currentLayer = doc.layers[i];
            var tempItem;
            if(currentLayer.visible == false) continue;   //We don't want to deal with hidden layers
            currentLayer.locked = false;                       //Unlock the layer if needed
            var layerName = new String( currentLayer.name );
            if ( layerName.indexOf("RasterizeMe") == 0 ) {
                currentLayer.hasSelectedArtwork = true;   //Select ALL in the layer
                if(doc.visibleBounds[2] == 0) continue;   // ignore empty layers
                var newoptions = new RasterizeOptions; 
                newoptions.resolution = 350;
                if ( doc.selection.length > 0 ) {
                    newGroup = app.activeDocument.groupItems.add();
                    for ( z = 0; z < doc.selection.length; z++ ) {
                        doc.selection[z].move( newGroup, ElementPlacement.INSIDE);
                    doc.rasterize (newGroup, newGroup.visibleBounds, newoptions);

    you're adding the group to the document, it will be the top most object on the top most layer
    newGroup = app.activeDocument.groupItems.add();
    use this to add the group to the current layer
    newGroup = currentLayer.groupItems.add();
    or if theres a better method of doing this.
    I would
    - loop through all layers,
    - hide them all, except the one you want to rasterize,
    - Rasterize the document
    - unhide layers

  • How to generate a pdf file using javascript?

    I would like to generate a pdf file having images in it using javascript. I tried jsPDF but getting some exceptions like
    Uncaught ReferenceError: pageWidth is not defined,
    fail to load pdf document
    Could anyone show me some pointers?
    Thank You
    Rahul

    Here is my code
    var myImg=new Image();
      myImg.src=arrData['employee'][1]['Image'];
      myImg.crossOrigin ="Anonymous";
       var imgData = this.getBase64Image(myImg);
       var doc = new jsPDF();
       doc.setFontSize(40);
       doc.text(35, 25, "Test Image");
       doc.addImage(myImg, 'JPEG', 15, 40, 180, 160);
       doc.save("sample1.pdf");
    I'm receiving the following error at 'addImage' function.
    Uncaught Error: getJpegSize could not find the size of the image
    Could you please help in pointing out where am I going wrong.
    Thank You

  • Using javascript to control the browser

    Hi all,
    One of the most requested features on our first Breeze
    project was a "quit" button. The easiest way to do so in an HTML
    environment is to use the command
    javascript: window.close();
    Type this into the address bar on your browser, and hit
    return. Isn't that neat?
    Okay, the scripting language in Flash (Actionscript) can
    simulate typing something in the address bar with the command
    getURL ("javascript: window.close();");
    ...all we have to do is add that actionscript to the
    onRelease event handler for a button in Flash. Then, add the button
    to your PowerPoint before you use Presenter, and when the student
    clicks it... voila!
    This same trick can be used to replace that MacroDobe©
    logo in the Breeze player. This time, when the user clicks the
    button, we'll use javascript to pop up an alert box with a clever
    message:
    getURL ("javascript: alert('Aren't we clever?');";
    This button has to be small, around 50 x 29 pixels, to
    properly replace the logo. To actually replace it, you need to
    publish your presentation to the hard drive like normal. Next, find
    the folder you published to, and place a copy of your "button.swf"
    file in the "data" subfolder. Then, edit (don't "open") the
    vconfig.xml file in the same subfolder using notepad. Near the top,
    you'll find an entry that says:
    <uireplace name="logo" value= "" />
    place the name of your button file between the quotation
    marks and save:
    <uireplace name="logo" value= "button.swf" />
    When you load up the training next time, the logo will have
    changed to your button.
    You'll have to do this every time you publish the training,
    as Presenter deletes & recreates all those subfolders each time
    you do. BTW, MacroDobe© does offer a small applet to parse
    this xml file for you... but they want 5 grand per copy. I'm
    thinking notepad works just as well :)
    cheers!
    Marc B

    The biggest difficulty with a Swing Applet is that it needs the latest version of the JVM to run and many people don't have this installed on their PC. You can set the Aplet tags to download the plug-in but it can discourage users and may not always work. I would only use a Swing Applet for webapps with a limited client base.

  • Using javascript to set non database values

    I finally figured out how to set the values of a non database form field using Javascript. The only problem is, I want this
    field to be a display only field, and the value does not get set if I make the field non updateable on the form. Can
    somebody please help me!! This is urgent.

    Stan,
    One way to do this is to call the doSubmit() function and create a page branch to handle your request. This way you can use apex validations and other goodies if your requirements change. Also this will save the state of your items on the page you are leaving.
    Edit
    I forgot to mention that you can pass a string parameter to the doSubmit function. The parameter will be the request sent to apex. For instance you could use doSubmit('DO_SOMETHING') and you can have a page branch which will fire if the request is equal to DO_SOMETHING.
    Cheers,
    Tyson Jouglet
    Edited by: Tyson Jouglet on Dec 1, 2009 10:11 AM

  • Using javascript to check datatype

    Hi again, I have a database name "cars"
    name    VARCHAR2(10)
    model   VARCHAR2(10)
    year     Date
    price NUMBER
    I have a form which staff fill in those details then save it.
    I am doing a client side validation. I AM ALSO DOING A SERVER SIDE TOO.
    Because the form is very long and takes about 15 mins to fill in a form. Basically I want to use javascript to check individual datatype in the database to check if whatever the user types in can fit into each datatype.
    Hope that makes sense.
    Thanks for your help.

    jquery is tightly integrated with apex. you will have to do the validation using jquery/javascript. check the following links
    Documentation | jQuery Validation Plugin
    jQuery Validation Plugin | Form validation with jQuery – this site is a work in progress
    javascript - Data type validation using jQuery Validation plugin - Stack Overflow
    [Solved] how can i do data type check validation using jquery ? - CodeProject
    Regards,
    Vishal

  • How to specify the saving path pdf by a "saveas" button in Javascript?

    Hello,
    Firstly, I use LiveCycle ES3 designer on PC. I created a form with a button executing a Java script that opens a dialog box "save as ..." like this:
    \ \ Script save-as \ \
    app.execMenuItem ("SaveAs");
    I would like to predefine a file path to open the dialog box that opens by default on the current location of the file "C: \ export \" for example.
    Could someone help me telling me the code and nomenclature to be used for this?
    I know Livecycle use XFA language and can use the "myDoc.saveAs ();" but I do not know how :-/
    I found this post in this forum but I don't understand how to use this code directly with a click event on a button
    http://forums.adobe.com/thread/685920
    There is also a tutorial here but I can not seem to apply
    http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript
    Thank you in advance for your help :-)

    Try putting this script in the click event of the button
    Hidden_Text_Field_Path.rawValue=this.somExpression;
    This ought to work using either FormCalc or JavaScript.  I'm not sure from your description whether you will need to use the full path name for the hidden text field or use a relative one, but that's not too hard to deal with.

  • Set value of a display only item using javascript

    I was trying to find an answer in the forum but my searches gave me no results. How do
    I set a value of a display only item using javascript (ajax)?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

    Vikas,
    Thanks for a fast responding. The type is Saves State. However, I tried to set the value
    of a display only item using:
    <script>
      function f_setDisplayOnly ()
        {$x('P80_X').parentNode.childNodes[4].nodeValue = 1;
    </script>without a result (or error). What am I doing wrong?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to use LayoutAdjustmentPreference using javascript?

    Hi All,
    I am a beginner in Javascript scripting and need your help on this.
    I have a need to change the US letter size Indesign document into A4 letter document using Javascript. I tried to change the layout and succeed but when I tried LayoutAdjustmentPreference, I could not get the result as it throws error message.
    Below is the javascript I tried:
    var myDocument = app.activeDocument;
    with(myDocument.LayoutAdjustmentPreference){
    enableLayoutAdjustment = true
    snapZone = "2 pt"
    allowGraphicsToResize  = true
    allowRulerGuidesToMove = true
    ignoreRulerGuideAlignments = false
    ignoreObjectOrLayerLocks = true
    with(myDocument.documentPreferences){
    pageSize = "A4"
    pageOrientation = PageOrientation.portrait;
    Could you please clarify where have I gone wrong in this code? or any better ideas?

    No, it is not correct.
    Use either with block (it saves you some typing):
    with (myDocument.layoutAdjustmentPreferences) {
         enableLayoutAdjustment = true;
         snapZone = "2 pt";
         // and so on
    or
    myDocument.layoutAdjustmentPreferences.enableLayoutAdjustment = true;
    myDocument.layoutAdjustmentPreferences.snapZone = "2 pt";
    both codes are equivalent.

  • Development on SharePoint on-line using JavaScript in an Script Editor

    Hi,
    I’m doing a SharePoint development on SharePoint on-line using JavaScript in a Script Editor. I've changed the Calendar NewForm.aspx  in SharePoint designer and I should check the Start Date and End date and I should change the procedure of Save button.
    The problem is I cannot have the component ID’s. I even tried to create new components and rebuild the form but my script sometimes working and sometimes not working.
    I've also tried SharePoint Apps in Visual Studio 2013 and Napa but I have problems  accessing SP lists.
    Could you please advise me?

    Hi Sachin,
    Before I read you reply, I had a "Eureka" moment that I was about to write about.  I got my Javascipt to read my the value that was set in the Filterdropdown!  However, you somewhat burst my balloon with the revelation about how re-sizing
    window changes their size (i.e., Large to Medium, etc)?  It is true, my function does not work when I click the "restore down" icon on the upper right corner of my window, then it works again when I maximize the window.  That sucks : (
         Oh, well.  Thanks just the same!
    For what it is worth, here is the script I wrote:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
        <script language="javascript">
            //This function reads the digest using /contextinfo.
            function ShowAlert()
                alert(document.getElementById("Ribbon.ContextualTabs.MyWork.Home.Data-Large-2-1").textContent);
        </script>
    </head>
    <body>
    What filter am I set to?  Click the Button snd I will tell you... <input type="button" value="Button" onclick="ShowAlert()";/>
    </body>
    </html>
    \Spiro Theopoulos PMP, MCITP. Montreal, QC (Canada)

Maybe you are looking for

  • Use of READ_TEXT IN SCRIPT

    Hi Techis Will u pls tell me IN DETAIL what is use of "PERFORM READ_TEXT" IN SAPSCRIPT  . PLS GIV EXAMPLE FOR EXPLANATION Rewards will be given for every helpful ans Regards PERFORM READ_TEXT TABLES ITEXT USING 'BK06' 'VBBK' TEXTNAME.         READ TA

  • How can I change default message encoding in Mail?

    In Lion, most of my email messages in Simplified Chinese is encoded in iso-2022-cn, while I want them in gb18030 or utf-8. Instead of choosing encoding manually every time, can I change the default message encoding somewhere?

  • UJR_WRITE_BACK: disaggregation based on previous yearu2019s data

    Hi Guys, We implement a UJR_WRITE_BACK that performs correctly the evenly disaggregation on two dimensions (product and time). We have to implement the disaggregation based on previous yearu2019s data mentioned in the How-To u201CHow To... Use the Wr

  • Does adobe photoshop elements 13 combo with prmiere elements 13 include microsoft essentials security?

    I bought adobe photoshop elements 13 combo with adobe premiere elements 13 at best buy and downloaded it on my pc. My Norton internet security stopped working because there was a 3rd party internet security . I was told Microsoft Essentials Security

  • How long does the replacement take????

    So i recently bought a lenovo y580 cam caulty so i called best buy they said they would replace and that they are mailing me a return thing to send the laptop back with then they will send me a new one when they recieve it via ups. when will i have m