• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
quicktime duration changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quicktime duration changes


  • Subject: quicktime duration changes
  • From: Gary Franks <email@hidden>
  • Date: Mon, 2 Jun 2008 17:59:45 -0500

I am trying to repeat with a folder full of quicktime movies, change the duration of each movie to 5 seconds, and save the shortened movie to an output folder with the same file name as the original. My code gets the selection changed to 5 seconds, but the copy, paste, save and close fails. Can't figure out what I'm screwing up. Would very much appreciate a hand.
Current:


tell application "Finder"

set startupDisk to (get the name of the startup disk)
set userName to (do shell script "whoami")
set moviePath to startupDisk & ":Users:" & userName & ":desktop:temp_movies:"
set outputPath to startupDisk & ":Users:" & userName & ":desktop:output:"

repeat with i from 1 to (count files in folder moviePath)
open file i in folder moviePath

tell application "QuickTime Player"
try
tell document 1
select all
set new_duration to 5
set the selection end to (the selection start + (new_duration * time scale))
copy document 1
make new document
paste document 1
rewind document 1
select none of document 1
close saving in outputPath
end tell
end try
end tell
end repeat
end tell


The way I read the Quicktime Player dictionary, you can't just set the duration. Maybe this is a stupid approach and I don't mind being told so, if there is a better way. All I want is the first 5 seconds of a whole bunch of 3 to 5 minute movies.
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden
  • Follow-Ups:
    • Re: quicktime duration changes
      • From: Alan Fairlie <email@hidden>
  • Prev by Date: Calling a nib item from AppleScript (and more..)
  • Next by Date: Re: Calling a nib item from AppleScript (and more..)
  • Previous by thread: Re: Calling a nib item from AppleScript (and more..)
  • Next by thread: Re: quicktime duration changes
  • Index(es):
    • Date
    • Thread