Automatically changing Safari's downloads folder

I want to have a automator script which can automatically change Safari's downloads folder. How should i do?

If you don't mind using GUI Scripting, and provided Safari is already open, the following script should do the trick:
set downloadsPath to "/POSIX/path/of/destination/folder"
tell application "Safari" to activate
tell application "System Events" to tell process "Safari"
    click menu item "Preferences…" of menu 1 of menu bar item "Safari" of menu bar 1
    click button "General" of toolbar 1 of window 1
    tell window "General"
        click pop up button 5 of group 1 of group 1 -- "Save downloaded files to:"
        key code 125 -- down arrow
        keystroke return -- "Other…"
        keystroke downloadsPath & return
        delay 1
        tell sheet 1
            if exists static text "The folder can’t be found." of sheet 1 then
                display dialog "This folder can't be found:" & return & downloadsPath buttons {"OK"} default button 1 with icon 1 giving up after 10
                click button "Cancel" of sheet 1
                click button "Cancel"
            else
                click button "Select"
            end if
        end tell
        click button 1 -- close the window
    end tell
end tell
Tested under OS X 10.9 “Mavericks” with version 7.0 (9537.71) of Safari.
Message was edited by: Pierre L. (added “delay 1”)

Similar Messages

  • Why is the contents of Safari's downloads folder different than the actual folder?

    Why is the contents of Safari's downloads folder different than the actual folder that resides in my users folder?

    Problem is if I delete that .plist I'll delete those downloads.  I'm still able to launch those downloads from that location so that tells that file is probably not corrupted. I need to be able to located that folder and transfer the downloads from it before I do anything like this.  So that begs the question, where is that folder located?  When I do a folder search I'm taken to a Downloads folder, but it's not the one that is showing up from within Safari as it's contents are too different. 

  • Mail.app prefs. fail to change location of Downloads folder.

    I recently migrated my mail from Eudora to Mail.app (Mac Pro, OS 10.6.8). I usedthe Mail.app Preferences to change the location of the Downloads (i.e. attachments) folder from the default location (Users>Library>Mail Downloads) to the subfolder in the OS Downloads folder that I used in Eudora. Despite this my attachments still end up in the default location. Help please!
    As an aside I would be running straight back to Eudora were it not for the death sentence pronounced by the absence of Rosetta in Lion. Here are some comments that I recently posted to the TidBits newsletter where there is an excellent article by Adam Engst on making the changeover to Mail.app:
    The major surprise for me was how really crude the Mail.app experience seems after 14 years of using Eudora. The way Mail handles mailboxes has been a source of major frustration. With Eudora I found it convenient to create separate Eudora Folders for my three accounts, each accessible via an alias of the respective settings file in the dock.  That way I could locate an item that I need much faster than when the mailboxes (and their subfolders) for all three accounts are crammed into a single sidebar - especially as mailbox folders enclosing subfolders will not open with a double click, precise clicking on the triangle is required.  The ability to access mailboxes from the Eudora Mailbox menu - drilling down through successive subfolders, if required - is vastly superior.  Similarly Mail's procedure for moving messages and/or creating rules is really primitive compared to Eudora's facility to create destination mailboxes as part of a single seamless process.  Given that development of Eudora ground to a halt in 2006 one could be forgiven for expecting a lot better from Apple's in-house e-mail client in 2011.

    Mike,
    Where in the Sidebar to the Mail window do you see any Sent mailboxes? Is there one beneath the Inbox when viewing at home? Check and report the settings at Mail Preferences/Accounts/Mailbox Behaviors, please. If you have to do this when at home, I understand. There is a way to instruct Mail to use a particular folder for a particular purpose that probably needs to be done on the home computer, but I would like to know those preference settings before proceeding with that.
    Ernie

  • Why can't I get the "save as" option when I download a file, it automatically saves EVERYTHING to download folder.

    When I download a file, I used to get an option to "save as", instead of just save. If I download a file I like to immediately download it into the appropriate folder on my desktop (not just one folder.) Instead I have to download it, go into the downloads folder and move it. I do a lot of downloading for work and this is just an extra step that I find so annoying. Is there a way to change this, or and "add on" feature to get "save as" as an option? I get this option on Internet Explorer, but I do not like using IE :(

    P.S. Not sure if this is important, but I am using Windows 8 :(

  • Safari Forgets Download Folder

    I have created a Safari downloads folder with a folder action script to automaticaly open certain files on download. The problem is Safari keeps forgetting the folder I set in Preferences and reverting to the Desktop for downloads. I have erased the preference files both in user and general with no effect. OS 10.4.4, nothing particularly weird running except Default Folder and Font Reserve. Thanks

    Why create a folder with an action script? Maybe that's the cause of your problem. Just create one in your finder, put it where ever you want it and set it in your Safari prefs as the default dl-folder and then activate in the same window 'open safe files after downloading', or something like it, cause I'm using the dutch version of Safari. This never gave me any problems.

  • Safari 5 - Download folder

    When I was using Safari 4 and I decided to download a piece of software, Safari allowed me to choose which folder I wished to save that particular file to. Since installing Safari 5 the download goes immediately to the \users\%%name\Downloads folder causing me to move the file to where I want it to be after the download is finished.
    The Options menu only allows me to select a folder different from the Downloads folder. Have I missed a setting somewhere or is the download process limited in Safari 5?

    I have the same concern. I want to choose what to do, I don't want the dumb computer to do it for me.
    It is a logical thing to improve or add features to an update and not to hide or eliminate them.
    I will go back to ver. 4

  • How do i change my default download folder?

    i cannot change my download folder in FF 3.6.2.

    Bad idea.
    I disagree. I like having the desktop set as my download folder, because it serves as an always-present reminder that I need to do something with the downloaded items. In the past, I have fought endless clutter in various other download folders, due to the fact that I was able to forget about them most of the time. When I needed something, it was a hassle to find it in the clutter, but at that moment I didn't typically have time to clean it up.
    However, it is important to be aware of the problems related to having too many things on the desktop.

  • Changing "Mail Downloads" folder for attachments

    It seems in Leopard Mail, when you double click an attachment to open it, it is temporarily saved to ~/Library/Mail Downloads. This is in contrast to (I think) Tiger, where it would be saved to the Downloads folder set in the General preferences. There is still a setting for the Downloads folder in the General preferences, and according to the help window, it is to "Specify the folder in which to temporarily save attachments you open from a message". To me, that means the same as the Tiger behavior. However, if I change this preference to, say, "Desktop", it seems opening an attachment (not explicitly saving it) still saves it to the ~/Library/Mail Downloads folder, not the assigned folder. Is this the correct behavior? If so, the help window is misleading. Personally, I would like the option to change this folder, although I suppose there are workarounds such as changing the Mail Downloads folder to an alias of the desired destination folder.
    thanks.

    Ok, so much for that clever workaround. Doesn't work, Mail just throws up an error and refuses to save the attachment. Any other ideas? I just want Mail to auto-save opened attachments onto the Desktop, in case I forget to explicitly save it, and so I don't have to root into subfolders to find it.

  • Change download folder

    How can I change the destination of files I download from the internet?  I don't necessarily want them going to the "Donloads" folder.  I want to have a choice, or specify a different folder altogether.  Windows users have this option, I have to believe us Mac users do to.  Thanks for whatever help I can get!

    Sorry I'm new to MAC. These replies seem to be just showing how you can change the default.
    I receive many files a day from customers. I need to select the folder where I put the file each time.
    I don't want to change the default download folder or create a preset list of Favourites where I can download.
    Any list would be too long to be practical.
    On Windows if I set my browser to always ask me for each download then I get  an explorer browse window.
    I can browse to any existing folder on my drive or even create a new subfolder for the download on the fly.
    At the moment (rather absurdly) I'm running Chrome in Windows in Parallels so that I can do this.
    Surely there must be a way to browse for the folder natively in OS X?

  • Firefox unexpectedly changes download folder

    After upgrade to FF7.0.1 (on Win7 Pro-64) I sometimes see a strange behaviour: while downloading a couple of files to the same folder, FF does occasionally change to another download folder - without request.
    I.e. I save files to folder A, suddenly FF offers me folder B. After choosing back to A, a couple of files later FF offers folder G, and so on.
    While working 10 - 12 hours with my PC, this happens once or twice a day. It doesn't depend on the file's format, happens with docs, videos, pics, pdfs, zips and other formats.

    Since 6 months, while using and upgrading releases (from FF7 up to currently FF12.0, on Win7 prof 64) that behaviour "unexpectedly changes download folder" still shows up. Sometimes after the 2nd or 3rd file, sometimes not until the 10th ... numbers are changing.
    So, former ideas "mime types could be a reason" won't work, because - in my case - the mime types of the downloaded files (i.e. series of pics from same address, series of movies from same address of my internet video recorder save.tv) are always the same (proved!)
    Result: there is still work to do - good luck!

  • Don't want to store temporary files in downloads folder firefox

    When opening an attachment from a website, such as a pdf, a windows pops up letting you choose to open with "Preview Document" or "save to...." If I choose "preview document," the pdf will automatically saved to my Downloads folder, which I don't want. In Winxp, temporary files are store in a temporary folder, and will be replaced by new temporary files. How do I do that in mac? I want to temporary "preview" the pdf and don't want it to save a copy to the download folder, because I use the folder for the downloads I want to keep. I use firefox btw. Thanks.

    Hi there,
    How did you do this? As it is not possible to see the private folder through the preferences window when setting the downloads folder. I even used TinkerTool to make all hidden files & folders visible...
    Thanks!

  • Playbook - Can't find Download Folder

    Can't locate my Download Folder on my Playbook (looking for e-mail attachments).  It is supposed to be in my File Manager, but don't see it in there!???
    Here is what HELP said..
    Thanks,
    Jack
    Q: Where are email attachments saved?
    A: Any email attachments you view from the Messages app are automatically saved in the Downloads folder on the BlackBerry tablet. You can access these files with the File Manager app on your BlackBerry PlayBook tablet.

    Go to App World on your Playbook
    Search for AIR Browser 
    Install (free app)
    You will find it using that app

  • How do I change the default folder that opens when uploading a file to the internet from my mac? (at the moment it automatically defaults to 'Downloads' folder)

    How do I change the default folder that opens when uploading a file to the internet from my mac? (at the moment it automatically defaults to 'Downloads' folder)
    For example...
    I am on a webiste and wish to upload a photo.
    I click on select file on the website
    Finder opens and defaults to 'Downloads' folder (it happens with all wesbites)
    How do I change this?

    I am on a webiste and wish to upload a photo.
    I click on select file on the website
    You are attempting to download the picture to your computer not uploading photo to the website if I am understanding you correctly.
    To change the download direction, you must do so through your browser's Preferences.  If you are using Safari, hopefully, someone who uses Safari will help you and/or post over in their forums.  I do not use Safari.
    If using Firefox>Preferences>General>Save Files to:

  • How do i stop downloads from automatically going to downloads folder

    Please help I don't want the documents I download from the web to automatically open with Preview and then automatically save the document to my downloads folder. This is just cluttering up my system with too much junk in my downloads folder.

    Safari Preferences>General:
    FireFox Preferences>General

  • How to check the location of download folder programmatically in browsers like Safari, Firefox etc on Mac?

    I am a part of Automation testing and I am downloading and installing the files programmatically with Selenium and Applescript on Mac. Is their any way to check the location of download folder on browsers programmatically?? if so pls suggest and also ways to change the location of download folder in Java or Applescript.

    You will need to read and write to preference files. A job best suited for the shell with either command line tool, defaults or PlistBuddy. Each application preference file has its own structure. Reading Safari's preference file is easy.
    defaults read $HOME/Library/Preferences/com.apple.Safari DownloadsPath
    Firefox isn't as clear but this should give you the download path.
    defaults read $HOME/Library/Preferences/org.mozilla.firefox NSNavLastRootDirectory
    Firefox also keeps a sqlite database of downloads which may be useful to query. Command line tools can be wrapped in Applescript. Also, programmatically changing preference files on an open application is discouraged.

Maybe you are looking for