Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Modified AppleScript version again...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Modified AppleScript version again...
Authored by: eriklager on Apr 30, '04 04:15:15PM
Supports spaces and other special characters, makes sure there really is a movie before trying to save, doesn't choke if there are multiple movies for some reason, and allows you to cancel when selecting file name.

set originalFile to do shell script "lsof |grep -i QTP| grep iTunes|head -1|awk '{ print $9 }'"
if length of originalFile is greater than 0 then
	set newFile to POSIX path of (choose file name with prompt "Save movie as:" default name "iTunes Video.mov")
	if length of newFile is greater than 0 then
		if newFile does not end with ".mov" then set newFile to newFile & ".mov"
		do shell script "cp -v '" & originalFile & "' '" & newFile & "'"
	end if
else
	display dialog "No movie found." buttons {"OK"} default button "OK"
end if


[ Reply to This | # ]
Modified AppleScript version again...
Authored by: reconbot on Apr 30, '04 06:15:52PM
I really like your script, I hope you don't mind I gave you a mention (and a copy of your script) on my website.

[ Reply to This | # ]
Modified AppleScript version again...
Authored by: useEvil on May 01, '04 01:47:38AM

Excellent! You can add the following to make sure the file creator and type are correct.

do shell script "/Developer/Tools/SetFile -t 'MooV' -c 'TVOD' '" & newFile & "'"

---
--
Fingerprint: 6196 6907 1E47 880A 76AA B6FD E9B6 A5D9 5D83 87BA
Public Key ID: 5D8387BA



[ Reply to This | # ]