|
|
10.6: Use AppleScript for precise trimming in QuickTime X
This will segment the front movie to the Movies folder. Be aware that the export queue is threaded, so exports will happen simultaneously (not necessarily a bad thing) unless you add a long delay between repeat loops. Enjoy!
property segment_length : (60 * 1) tell application "QuickTime Player" activate if not (exists document 1) then error number -128 repeat display dialog "Enter the base name for the export movie file:" default answer "" set the base_name to the text returned of the result if the base_name is not "" then exit repeat end repeat set the movie_length to the duration of document 1 set the segment_count to the (movie_length div segment_length) if (movie_length mod segment_length) is not 0 then set the segment_count to the segment_count + 1 set start_time to 0 repeat with i from 1 to the segment_count if i is the segment_count then set end_time to movie_length else set end_time to start_time + segment_length end if set current time of document 1 to start_time trim document 1 from start_time to end_time set the target_file to ((path to movies folder as string) & base_name & "-" & (i as string) & ".mov") export document 1 in file target_file using settings preset "Computer" -- or "iPhone" delay 1 -- set to large number of seconds if you don't want the exports to queue my reset_movie() set start_time to end_time end repeat set current time of document 1 to 0 end tell on reset_movie() tell application "System Events" tell process "QuickTime Player" keystroke "z" using command down end tell end tell delay 2 end reset_movie Edited on Mar 08, '10 01:53:50PM by mr. applescript
10.6: Use AppleScript for precise trimming in QuickTime X
Hi, nice tips guys.
I had trouble running mr. applescript's script - the time markers work well, but I got 5 identical movies. Perhaps keystroking 'z' using System Events is causing a problem? I've taken the liberty of adjusting the script so it closes and opens Document 1 instead:
mr applescript's QuickTime Player script PhilHints branch.scpt QuickTime Player occasionally fails to complete the export process though. I export movies linearly by using this code:
Exports only have physical size after the export is complete. I've incorporated the above code into the new script. Cheers, PhilHints |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|