Safari cache-folder

How to analyse Safari cache-folder and find all html/htm/php/… files and copy those out of cache to folder in desktop? I want to do this using AppleScript/some unix command, not using apps like File Juicer.

If you post twice (as you did), don’t hesitate to use the delete link to remove one of them. (I did it in this case)

This will get you an alias to every file in Safari’s cache folder:


set Caches to alias ((path to library folder from user domain as text) & "Caches:Safari:")
tell application "Finder" to set CF to (files of entire contents of Caches) as alias list

They are HTML text files, so you’ll have some parsing to do to find what you want.