Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Guys, I'm on a mac and want to access the Safari Preferences File using a bash script. I want to know the default folder set by a user for saving downloaded files. I know that the preferences are in the '/Users/username/Library/Safari' folder on mac.

Which file stores the "Save Downloaded files to:" value?

share|improve this question
up vote 1 down vote accepted

The following commands will access the preference API and write the preference you want.

defaults write com.apple.safari DownloadsPath = \"~/Downloads\"
defaults write com.apple.safari NSNavLastRootDirectory = \"~/Downloads\"

DownloadsPath is the default download directory. NSNavLastRootDirectory is the folder last accessed in the Save dialog.

The file is ~/Library/Preferences/com.apple.Safari.plist, by the by. But using the defaults utility is preferable to manually modifying the file.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .