Save to file to desktop

Hi All,
I am trying get one of my buttons to link to a PDF file which
would not open, but would ask the user where to save the file (i.e.
to the desktop), is this possible?
Thanks very much

Hi,
I need this too, thanks Andreu1 I found a code in the link
you sent, and I like to add it here:
package {
import flash.display.Sprite;
import flash.events.*;
import flash.net.FileReference;
import flash.net.URLRequest;
import flash.net.FileFilter;
public class FileReference_download extends Sprite {
private var downloadURL:URLRequest;
private var fileName:String = "SomeFile.pdf";
private var file:FileReference;
public function FileReference_download() {
downloadURL = new URLRequest();
downloadURL.url = "
http://www.[yourDomain
file = new FileReference();
configureListeners(file);
file.download(downloadURL, fileName);
private function
configureListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.CANCEL, cancelHandler);
dispatcher.addEventListener(Event.COMPLETE,
completeHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR,
ioErrorHandler);
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS,
progressHandler);
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
dispatcher.addEventListener(Event.SELECT, selectHandler);
private function cancelHandler(event:Event):void {
trace("cancelHandler: " + event);
private function completeHandler(event:Event):void {
trace("completeHandler: " + event);
private function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
private function openHandler(event:Event):void {
trace("openHandler: " + event);
private function progressHandler(event:ProgressEvent):void {
var file:FileReference = FileReference(event.target);
trace("progressHandler name=" + file.name + " bytesLoaded="
+ event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
private function
securityErrorHandler(event:SecurityErrorEvent):void {
trace("securityErrorHandler: " + event);
private function selectHandler(event:Event):void {
var file:FileReference = FileReference(event.target);
trace("selectHandler: name=" + file.name + " URL=" +
downloadURL.url);
}

Similar Messages

  • Save log file on Desktop

    Hi,
    I have created a script (see below) which alert unused character and paragraph style in active document.
    My Script
    myUnusedParagraphStyleName();
    myUnusedCharacterStyleName();
    function myUnusedParagraphStyleName()
    var myDoc = app.activeDocument;
    var myParStyles = myDoc.allParagraphStyles;
    var foundPStyles = [];
    for (i = myParStyles.length-1; i >= 2; i-- ){
    foundPStyles.push(myParStyles.[i].name);
    alert(foundPStyles.join("\r       "));
    function myUnusedCharacterStyleName()
    var myDoc = app.activeDocument;
    var myCharStyles = myDoc.allCharacterStyles;
    var foundCStyles = [];
    for (i = myCharStyles.length-1; i >= 1; i-- ){
    foundCStyles.push(myCharStyles.[i].name);
    alert(foundCStyles.join("\r       "));
    But I want to save my alert message as a log file on my Desktop. I have search and found an example (see below) but I couldn't merge this code with my script.
    Can anybody please merge this code within my JS. So that my script save a log file in desktop. I really appreciate all your support.
    Example taken from Adobe Forum
    var myDoc = app.activeDocument;
    var myDocPath = myDoc.filePath;
    var myDocName = myDoc.name;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "\\b(\\w.+\\s000\\s000\\s00)";
    var mySearch = myDoc.findGrep();
    var myFound = new Array()
    for (var j = 0; j < mySearch.length; j++)
    myFound.push (mySearch[j].contents);
    alert(myFound);
    var inc=0;
    var myLogFile = new File(myDocPath.fsName + "/Report_" + myDocName.split(".")[0] +".txt");
    if(myLogFile.open("w", undefined, undefined))
    myLogFile.writeln("Tool name : Report Generator for CS5");
    myLogFile.writeln("************************************");
    if(myFound.length != 0)
            myLogFile.writeln("");
            for (var k = 0; k<myFound.length; k++)
       serialno = k + 1;
       myLogFile.writeln("  "+serialno+".  "+myFound[k]);
    myLogFile.execute();
      else
       myLogFile.writeln("No terms found");
    Thanks in advance.
    Mon

    Here is it.
    var foundPStyles = [];var foundCStyles = [];var myDoc = app.activeDocument;var myDocPath = myDoc.filePath;var myDocName = myDoc.name;  myUnusedParagraphStyleName();myUnusedCharacterStyleName();myWrite2Log();  function myUnusedParagraphStyleName(){          var myParStyles = myDoc.allParagraphStyles;          for (i = myParStyles.length-1; i >= 2; i-- )          {                    foundPStyles.push(myParStyles[i].name);          }          // alert(foundPStyles.join("\r       "));}function myUnusedCharacterStyleName(){          var myCharStyles = myDoc.allCharacterStyles;          for (i = myCharStyles.length-1; i >= 1; i-- ){                    foundCStyles.push(myCharStyles[i].name);          }          // alert(foundCStyles.join("\r       "));}function myWrite2Log(){          var inc=0;          var myLogFile = new File(Folder.desktop+"/Report.txt");          if(myLogFile.open("w", undefined, undefined))          {            myLogFile.writeln("Unused ParaGraph Styles\n=======================\n\r");            if(foundPStyles.length != 0)            {                      myLogFile.writeln("");                      for (var k = 0; k<foundPStyles.length; k++)                      {                                serialno = k + 1;                                myLogFile.writeln("\t"+serialno+".\t"+foundPStyles[k]);                      }            }            else            {                      myLogFile.writeln("\nNo Unused ParaGraph Styles Found\n\n");            }              myLogFile.writeln("\n\nUnused Character Styles\n=======================\n\r");            if(foundCStyles.length != 0)            {                      myLogFile.writeln("");                      for (var k = 0; k<foundCStyles.length; k++)                      {                                serialno = k + 1;                                myLogFile.writeln("\t"+serialno+".\t"+foundCStyles[k]);                      }            }            else            {                      myLogFile.writeln("\nNo Unused Character Styles Found");            }          }     myLogFile.close();}
    Hope this Helps to you

  • After the new 10.9.2 Maverick upgrade, my Photosmart C4480 3 in 1 printer can not scan and save the file to desktop or documents.  You can only see the image in the print preview area. Does anyone know how to fix this or when a fix will be out?

    After Aple support downloaded the new 10.9.2 Maverick upgrade on my MacBook Air, my Photosmart C4480 3 in 1 printer can not scan a document and load the file on to my desktop or document file. (You can see the doc image in the preview but it doesn't save it.) Does anyone know an Apple fix for this or when the fix will be out?  After hours of trying reloading, and the usual fixes, etc. Apple told me to call HP, and HP told me they don't support Mac.  It does not seem honorable of Apple to put out an upgrade and not tell people it will destroy their scanning ability, and that the only thing to do is to buy another printer/scanner.

    Have you tried using Applications/Image Capture to scan.
    Vuescan often works.
    VueScan
    VueScan FAQ

  • How to save MP4 files from Desktop to a folder

    I have a number of MP4 files on my desktop which I have imported from my camera.
    Please could someone explain - in VERY simple terms how to transfer these into a file or folder (sorry I don't know the correct terminology) so they are no longer on the desktop.
    Thanks in advance for your assistance.

    Hi
    A "file" is any kind of object such as a music file, document, video file, that lives on your computer. A folder contains one or more files. It's based on the paper file/folder analogy. So yes, you would store files in a folder. In fact, your desktop is just another folder, but its contents are displayed on the screen when you log in.
    So you can create a folder on the desktop by clicking once anywhere on the desktop to focus on the Finder, then click the shift, command and N keys (hold down shift and command - it's just to the left of the space bar - and click N). This creates a new folder called "Untitled folder" and the name is editable, which means you can type a new name for it (eg "My music files"). Type a new name and hit the Return key.
    Then drag the MP4 files into the new folder to move them. You can select more than one file at once by command-clicking on each one in turn to highlight them, then click on any one of them and drag into the folder.
    Post back if you have any trouble.
    best,
    Matt

  • How do I save a file to desktop?

    I have a file that I have saved in my download folder. I am wanting to create a desktop icon to access the file. It is a Word folder.
    Thanks

    Right click and select '''''Create A Shortcut'''''. It will be placed right there and you
    can move it to where you want. '''But''' sometimes a shortcut cannot be
    created in some folders, so the system will ask if you want to place it on the
    desktop. Again, from here you can put it where you want.

  • HT1338 Safari/Bonjour won't save .wav files to desktop without adding .html

    I use the Dragon Dictate 3.4.0 with the Dragon Recorder app on my iPhone 5 (iOS7.0.4).  This app allows for me to use a wifi connection to upload dictation (.wav) to the Mac.  The instructions using Safari and Bonjour are simple to follow.  However, when I right-click to save the .wav file Safari/Bonjour adds the extension .html to the file.  This makes it unable to be read as a .wav file by Dragon transciption. I don't have this problem when following the instructions for using an alternate browser, in this case Firefox.  The problem with using Firefox is the number of steps involved.  It should be less cumbersome and using Safari/Bonjour would make it so. 
    Why is the .html extension being added to a .wav file when asking Safari to save it?
    Jerry

    Does the ext directory have the php_oci8.dll? In the original steps the PHP dir is renamed. In the given php.in the extension_dir looks like it has been updated correctly. Since PHP distributes php_oci8.dll by default I reckon there would be a very good chance that the problem was somewhere else. Since this is an old thread I don't think we'll get much value from speculation.
    -- cj

  • Cant' save files on desktop or move to desktop

    Hello,
    1. I can't save any file to desktop or move any file to desktop.
    2. If I klick the Icon "Desktop" in the Finder-Window I get the Message "There is no default application specified to open the document “Desktop”." and the option "Choose Application".
    Any ideas to solve the problem?
    a4n

    Thank you for the hint.
    Opened "Get Info" and "locked" is not selected but ...
    "Get Info" says the Desktop folder is not a "folder"! It's a "package" (General, Kind).
    Is it possible to change from "Kind: package" to "Kind: folder"?

  • How can I get a pdf. to open in Safari, all i'm getting is a new window with a black, blank page, instead of the pdf., and I don't want to save the file to the desktop, Safari didn't use to do that, and I don't have Adobe in the internet plug in folder.

    How can I get a pdf. to open in Safari, all i'm getting is a new window with a black, blank page, instead of the pdf., and I don't want to save the file to the desktop, Safari didn't use to do that, and I don't have Adobe in the internet plug in folder.

    Hi
    Please take a look to this thread Re: Can I refresh the browser rather than open a new tab?

  • How do I save pdf files onto my desktop?

    I have converted a word document to pdf and now I want to save it onto my desktop so I can email it to someone.
    How do I save the pdf files from acrobat onto my desktop computer?

    Hi DCG,
    Please follow the below mentioned link, as it shows step by step how to save the PDF files on your desktop:
    http://helpx.adobe.com/acrobat-com/help/export-save-print-documents.html
    Regards
    Gurleen

  • HT6114 Since I have updated to Maverick, every time I download anything, it automatically saves the file on my desktop.  I do not want it saved on the desktop

    Since I have updated to Maverick, every time I download anything, it automatically saves the file on my desktop.  I do not want it saved on the desktop.

    Download how?  If you are downloading via Safari, see Safari Preferences, General.

  • Firefox saves pages as two files on desktop

    Why does Firefox save two files / folders on my desktop when I use the"Save Page As" option to save a visited website on my desktop?
    Can this be modified? I hate having to handle two files / file groups when I want to save a file for quick access, or for re-sending to others.
    Thanks!

    Don't use "say page as" ...see instructions on how to create shortcuts from this link, using the icon to the left of the address bar will only create one icon on the desktop
    http://support.mozilla.com/en-US/kb/creating+a+desktop+shortcut+to+a+web+page

  • Why does FF save files to desktop, when I have "downloads" checked in options? This is a new issue with the latest version 3.6.3 Windows XP Thanks.

    Why does FF save files to desktop, when I have "downloads" checked in options? This is a new issue with the latest version 3.6.3 . Using Windows XP Driving me nuttier! Thanks.
    (Is is that MicroNetFrame Asst thing?)
    == This happened ==
    Every time Firefox opened
    == When I installed latest version

    Thanks for your reply. I appreciate your help.
    It was just a hunch that MircoNetFrame was causing the problem. I disabled it as you suggested, and I still have the problem.
    I just changed under Tools>Options> General - had checked "ask me every time" under downloads, so instead of asking me, FF saved the download to I know not where. It no longer saves it to the desktop, leaving a duplicate in "my documents".
    In windows, I have found unless one knows the entire name of the document, one can never find anything. It isn't listed under recent ''''''__. I can't recall the nomenclature, but the
    capability is ridiculous. So, I don't know where that file I just downloaded is!
    I downloaded a PDF file, but this happens with all DL's. It was so easy to have them all stacked in one place and I could recall
    what I had and when I downloaded it easily.
    Do you have any other suggestions other that going back to the old version of FF, which I would rather not do?
    Thanks again for your time, it is very considerate to help a complete stranger, I must say. Sounds like something I might do! Cheers!

  • Since updating to OS X Yosemite, I am unable to save files into another computer or server. I have to save it on my desktop and then drag it into the server. How do i correct this?

    Since updating to OS X Yosemite, I am unable to save files into another computer or server. I have to save it on my desktop and then drag it into the server. How do i correct this?

    Ok this worked to solve the error.
    Use cmd prompt in windows 7 or 8 and run as admin:
    sc config lanmanworkstation depend= bowser/mrxsmb10/nsi
    sc config mrxsmb20 start= disabled
    No need for all that power shell nonsense as shown elsewhere for windows 8.
    That's it. Also force smb2 disabling on the apple side for good measure.
    With the above I was able to network mavericks and windows 8.1 pro flawlessly. He issues I had before where I could not read video, ISO and audio files (but could open documents and pictures from the windows machine connected to an apple network share folder went away.

  • Cannot Save Files to Desktop

    User is running Photoshop CS 2 on a Mac Pro 3ghz machine. He gets and issue where he intermittently (but every day) cannot save Pshp files, MS Word Files, Indesign flies to the destkop. His workaroung is to save to USB drive and then copy files to the desktop.
    I looked in other forums about this issue and they relate to permissions. Funny thing is I have rebuilt the permissions and even put a clean build on the machine and re-installed Adobe CS.
    What permissins are associated with Pshp files tat would prevent "Save" or "Save As".??

    Hi Paul
    Have you checked that the permissions are correct for the user's Desktop folder? (Go to his home folder, select the Desktop folder and select File>Get Info.) He should be the owner and have Read & Write permissions.
    If that's not the problem you could try creating a new user account to see if this solves the problem.

  • HT201250 I accidentally didn't save a document on my desktop--a report.  Can I go back with time machine and recover my desktop and save the file?

    I accidentally didn't save a document on my desktop--a report.  Can I go back with time machine and recover my desktop and save the file?

    If you saved it at least once, then time machine should have a copy of the document at the state you last saved it.  I'm guessing tha's not the case however or the copy of the file would still be on your Desktop.
    If you never saved it a single time, yet closed the window and dismissed the warnings about an unsaved document, then you are out of luck as far as I know.

Maybe you are looking for