Fine-tuning “Open safe files after downloading”

daemonsfilesafari

Is it possible to fine-tune the "Open safe files after downloading" setting in Safari? For example, to make Safari open files like ".ical" et. al., but not Zip-files.

If macOS has no built-in support for this, could a solution be a UNIX script daemon that instantly detects new files in the Downloads directory and opens files with certain extensions?

Best Answer

The preferences file is located at ~/Library/Preferences/com.apple.DownloadAssessment.plist

If the file doesn't exist, then create it and include the following:

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com-PropertyList-1.0.dtd"> 
<plist version="1.0"> 
    <dict> 
        <key>LSRiskCategorySafe</key> 
        <dict> 
            <key>LSRiskCategoryExtensions</key> 
            <array> 
                <string>docx</string> 
                <string>xlsx</string> 
            </array> 
        </dict> 
    </dict> 
</plist>

To exclude Zip files, add the following to the preferences:

<dict> 
    <key>LSRiskCategoryNeutral</key> 
    <dict> 
        <key>LSRiskCategoryExtensions</key> 
        <array> 
            <string>zip</string> 
        </array> 
    </dict> 
</dict>

More info at: Source