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


Click here to return to the '10.6: Use AppleScript for precise trimming in QuickTime X' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Use AppleScript for precise trimming in QuickTime X
Authored by: philostein on Mar 12, '10 04:52:50AM
I think the beeps were mine. 'Save as…' - genius! Ah, the power of constructive criticism. I've re-written the PhilHints version of mr. applescripts' script and saved it in the same place:
mr applescript's QuickTime Player script PhilHints branch.scpt
It contains most of the ideas you were thinking of.

It will overwrite old files if the new ones have the same name. It seems to work on audio files too. Remember, the segmenting code is still mr. applescript's.
Cheers, PhilHints.

[ Reply to This | # ]
10.6: Use AppleScript for precise trimming in QuickTime X
Authored by: lwein on Mar 07, '13 06:04:55AM

Hello there,
I'm new to Applescript and I randomly found your script doing almost exactly what I need.

Actually I'm asked to write a script that runs in command line with four arguments. The name of the file to trim, the start time of the trim, the end time of the trim and the name of the file under which to be saved.

Reusing your "mr applescript's QuickTime Player script PhilHints branch", I feel I'm not too far far from the result.
The problem is that I get a strange error: "QuickTime Player got an error: Can't make file "myMac:Users:myName:Movies:theFile.mov into type integer"

Here is the code at this time:
<code>

on run argv
set fileName to POSIX file (get item 1 of argv)
set start_trim to item 2 of argv
set end_trim to item 3 of argv
set resultName to item 4 of argv

log start_trim
log end_trim

tell application "Finder"
activate
open file fileName using application file "QuickTime Player.app" of folder "Applications" of startup disk
end tell

try
---This runs the app

tell application "QuickTime Player"
try
activate
trim document fileName from start_trim to end_trim
save document fileName in file resultName
close document fileName without saving
display dialog "Movie segmented" buttons {"OK"} default button "OK" giving up after 2

on error a number b
display dialog a
end try
end tell

end try

end run
</code>

Could someone help me please?



[ Reply to This | # ]