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: 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

- 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
  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 "" 
      default location (path to music folder)))
    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 | # ]