I just hacked together a little applescript that grabs files from your temporary directory to another place, renames them according to the current applications main window’s name. Basically this sounds like nothing, but what it actually does is very useful if you like to save some of the songs playing on a flash based radio stream like pandora.com. download the file here (2.4 kB zipped file).
related:
set originalFile to do shell script “ls -1t /Users/XXX/Library/Caches/TemporaryItems/plugtmp/ | grep -i access | head -n 2 | tail -n 1″
tell application “Camino”
set defaultName to name of window 1
end tell
if length of originalFile is greater than 0 then
set newFile to POSIX path of (choose file name default name defaultName)
if length of newFile is greater than 0 then
if newFile does not end with “.mp3″ then set newFile to newFile & “.mp3″
do shell script “/bin/cp -v ‘” & “/Users/XXX/Library/Caches/TemporaryItems/plugtmp/” & originalFile & “‘ ‘” & newFile & “‘”
end if
else
display dialog “No audio file found. Please make sure that a tune is playing in pandora.” buttons {”OK”} default button “OK”
end if