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


Click here to return to the 'A more efficient version' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A more efficient version
Authored by: eriklager on May 01, '04 07:00:03AM
The first script took a long time to find the movie file on my computer. This one should limit the search a little. As already mentioned, save it in Library/iTunes/Scripts for easy access from the Script menu in iTunes.

set originalFile to do shell script "lsof -wa -Fn -c iTunes +D /tmp | grep -i QTP | head -1 | cut -c 2-"
if length of originalFile is greater than 0 then
	set newFile to POSIX path of (choose file name 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 "/bin/cp -v '" & originalFile & "' '" & newFile & "'"
		do shell script "/Developer/Tools/ttt -t 'MooV' -c 'TVOD' '" & newFile & "' || true"
	end if
else
	display dialog "No movie found. Please make sure that the movie is currently visible in iTunes." buttons {"OK"} default button "OK"
end if


[ Reply to This | # ]
A more efficient version
Authored by: jpchoisne on May 01, '04 03:31:14PM

I'm lazy so I use an even more efficient version.

It's called iGetMovies and you can get it at :

http://homepage.mac.com/djodjodesign/

Ok it's in French but easy to understand. Once the movie has been downloaded you just click on the OK button of the app and the file will save to your desktop.

Works with iTunes 4.5

Enjoy !



[ Reply to This | # ]
A more efficient version
Authored by: koncept on May 01, '04 09:22:28PM
Made a few modifications according to what others have posted here. I Could not test the cp -v issue in Jaguar as I am running Panther.

(*
+------------------------------------------------+
Based on script by Erik Lagercranyz
Adapated by koncept@nonamescriptware.com

Info:
- Accounts for spaces in file names
- Choose output location 
- Use setFile if avail. 
- Choose between iTunes or Safari streams
- Opens finished movie in QuickTime Player
+------------------------------------------------+
*)

activate me
set hasSetFile to (do shell script "/bin/test -x /Developer/Tools/SetFile;echo $?") as number
set theApp to button returned of (display dialog "What app should I record from?" buttons {"Safari", "iTunes"})
set theCmd to "lsof -wa -Fn -c " & theApp & " +D /tmp | grep -i QTP | head -1 | cut -c 2- "
set testForStream to (do shell script theCmd)
if length of testForStream < 1 then
  display dialog "Could not detect a valid movie stream." with icon stop
else
  with timeout of 1200 seconds
    display dialog 
      "Please click proceed when the video is fully loaded." 
      buttons {"Proceed"} default button 1
  end timeout
  set saveTarget to quoted form of (POSIX path of 
    (choose file name with prompt 
      "Where shall I save the recorded stream?" 
      default name "iTunesVideo.mov" 
      default location (path to music folder)))
  try
    do shell script ("cp -v $(" & theCmd & ") " & saveTarget)
    if saveTarget is 0 then do shell script "/Developer/Tools/SetFile -t 'MooV' -c 'TVOD' " & saveTarget
    do shell script ("usr/bin/open -a QuickTime\\ Player " & saveTarget)
  on error err number num
    display dialog "( " & num & ") Could not copy the movie because : " & return & err
  end try
end if


[ Reply to This | # ]
Script causes Classic to load?!
Authored by: maddys_daddy on May 10, '04 03:55:39PM

The script above worked flawlessly, except for the fact that it caused Classic to launch. I'm not sure, but I think that it might have something to do with Quicktime on my system, since some quicktime files try to open in classic quicktime. Any ideas how to fix this?
Thanks for the great script, though!



[ Reply to This | # ]
A more efficient version
Authored by: eriklager on May 02, '04 07:15:27AM

And of course /Developer/Tools/ttt should have been /Developer/Tools/SetFile. I don't know how "ttt" got in there. Oh well.



[ Reply to This | # ]