“I read about …I’m a Mac user and I want to protect all my documents, how can I do that?”
Answer: Using a Folder Action, you can automatically move files from your Temporary Downloads folder to your default downloads folder.
Wow, you rock! This is probably flawless, bugless, and covered by some sort of guarantee, right?
Heck no. It comes with no promises, no warranty, no suitablity for any purpose expressed or implied…. Caveat any- and every-thing. All I’ll say is that it works for me, and should work for you. Use at your own risk, your mileage may vary, do not taunt Happy Fun Ball.
NOTE: This script is designed to run on Mac OS X which has a non-standard ‘mv’ command with a ‘-n’ flag which will refuse to overwrite an existing file.
It has been tested under 10.4.6 and MacOpera build 3447 (which is Opera 9.0 Final. See opera:about to verify your version
Note that MacOpera 9 fixes one previous annoyance which was the use of an odd character in the default cache path, which used to look like this: ~/Library/Caches/Opera Cache/Cache ƒ. That wreaked havoc with shell scripts. Good riddance.
Warning: If the Temporary Downloads folder itself is deleted, I expect that the Folder Action will be disabled, even if the folder is re-created. You will need to repeat these steps (at least some of them). However, the folder itself is not deleted even when the cache is emptied.
How do I use this?
Step 1: Open /Applications/AppleScript/Script Editor.app and paste in this code:
on adding folder items to this_folder after receiving added_items
do shell script “/usr/local/bin/save-opened-opera-files.sh”
end adding folder items to
Note that we will be creating /usr/local/bin/save-opened-opera-files.sh below and you can call that file whatever you want.
Step 2: Save the Script Editor file to /Library/Scripts/Folder Action Scripts/. (You don’t have to save it there, strictly speaking, but it does make it easier in certain circumstances.) I called mine “SaveTempDownloads.scpt”
Step 3: Open the Temporary Downloads folder. This is in ~/Library/Caches/Opera/Temporary Downloads/ and Right/Control Click onto the folder and choose “Enable Folder Actions” if it isn’t already.
Step 4: Right/Control Click on the Temporary Downloads folder and choose “Attach a Folder Action”
Step 5: Choose the Folder Action Script, and select the file you saved in Step 2 above (“SaveTempDownloads.scpt” in my example)
Step 6: Save save-opened-opera-files.sh.zip to your Desktop, then issue these three commands in Terminal.app:
- unzip ~/Desktop/save-opened-opera-files.sh.zip
- chmod 755 ~/Desktop/save-opened-opera-files.sh
- sudo mv -i ~/Desktop/save-opened-opera-files.sh /usr/local/bin/
Note that you will have to enter your administrator password to use sudo
Step 7: After all the steps, simply Open a file in Opera and see where it ends up. If it is in your Temporary Downloads folder, you know something went wrong.