• Oregistrerad
  • 2005-01-23 23:17

Har nån ett applescript som kan lyfta en jpg från alla mina quicktime-filmer i en batch, eller känner nån till ett program som kan göra det?

Jag önskar mest en droplet där jag droppar mina filmer och sen exporterar quicktime pro en jpg, gärna från tex 1 sekund in i filmen, och sparar dom med filmens namn i en mapp för min video-databas.

Jag hittade Apples script som exporterar en jpg på en öppen fil, men det skulle ta löjligt lång tid för mig att modifiera det. Det såg ut så här:

tell application "QuickTime Player"
activate

try
if not (exists movie 1) then error "No movies are open."

stop every movie

-- CHECK FOR THE CORRECT VERSION
set QT_version to (QuickTime version as string)
set player_version to (version as string)
if (QT_version is less than "5.0") or ¬
(player_version is less than "5.0") then
error "This script requires QuickTime 5.0 or greater." & ¬
return & return & ¬
"Current QuickTime Version: " & QT_version & return & ¬
"Current QuickTime Player Version: " & player_version
end if

set the new_file to choose file name with prompt "Name & location for the saved frame:" default name "image.jpg"
set AppleScript's text item delimiters to ":"
set the new_name to the last text item of (the new_file as string)
set the destination_folder to ((text items 1 thru -2 of (the new_file as string)) as string) & ":"
set AppleScript's text item delimiters to ""

my status_dialog("Extracting the current frame…")
set the current_time to current time of movie 1
select none of movie 1
copy movie 1
make new movie
paste movie 1

my status_dialog("Creating temp folder…")
-- create a unique temp folder
repeat
set this_name to (random number from 100000 to 999999) as string
tell application "Finder"
if not (exists folder this_name of the desktop) then
set the temp_folder to (make new folder at desktop with properties {name:this_name}) as alias
exit repeat
end if
end tell
end repeat

my status_dialog("Exporting frame image as JPEG…")
set the tempfile_name to "TEMP_IMAGE"
set the target_file to ((temp_folder as string) & tempfile_name)
-- export the image as a JPEG
export movie 1 to file target_file as image sequence using settings preset "JPEG, 25 fps"
close movie 1 saving no

tell application "Finder"
--rename the image and move it to the desktop or other folder
set (the name of the first file of the temp_folder whose name ends with "1.jpg") to the new_name
move file new_name of the temp_folder to folder destination_folder with replacing
end tell
my status_dialog("Deleting the temp files…")
tell application "Finder"
-- delete the temp folder and its contents
delete temp_folder
empty trash
end tell

display dialog "Done." buttons {"Show File", "OK"} default button 2
if the button returned of the result is "Show File" then
tell application "Finder"
activate
reveal the new_file
end tell
end if
on error error_message number error_number
if the error_number is not -128 then
beep
display dialog error_message buttons {"Cancel"} default button 1
end if
end try
end tell

on status_dialog(this_message)
tell application "QuickTime Player"
activate
display dialog this_message buttons {"•"} default button 1 giving up after 2
end tell
end status_dialog

/Pontus