Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.