我在想如果有人能告诉我如何让这个脚本工作。我尝试了几个小时,我无法弄清楚它为什么失败。无法使用苹果脚本将mov导出到png中
此脚本告诉Quicktime在快速时间电影/演示(由keynote生成)中前进,并为该电影中每个章节的每个最后一帧导出图像。
property Main_folder : missing value
set Main_folder to choose folder
tell application "QuickTime Player 7"
if not (exists document 1) then error "No movies are open."
stop movies
tell front document to set {currMovie, T_name, duration_list, current time} to ¬
{it, text 1 thru -5 of (get name), duration of chapters of (get first track whose kind is "Sprite"), 0}
set T_target to my makeFolder(T_name)
repeat with i from 1 to (count duration_list)
tell currMovie
set current time to current time + (item i of duration_list)
export to (T_target & T_name & " Chapter " & i) as picture using settings preset "Photo-JPEG" -- or "Uncommpressed", or "PNG"
end tell
end repeat
end tell
on makeFolder(n)
tell application "Finder" to return (make new folder at Main_folder with properties
这里我的问题是,它保存PICT格式而不是PNG图像。 脚本的relevat一部分是在这里:
export to (T_target & T_name & " Chapter " & i) as picture using settings preset "Photo-JPEG" -- or "Uncommpressed", or "PNG"
我尝试了用PNG和只有照片的JPEG,但它仍然只是在PICT格式生成图像
有谁知道如何做到这一点?我在脚本中找不到任何错误......它应该可以工作。
欢迎任何建议! Thx提前。
最好的问候,
zhengtonic
更新
如果有人有兴趣,我发现了原因:
的QuickTime 7不能够从一个MOV虎视眈眈的静止图像和将其导出为png/jpeg。 我通过将视频转换为mp4并提取某些帧找到了解决方法。
我发现了另一个解决方案,但thx队友! – zhengtonic 2010-12-17 19:50:45