我在想如果有人能告訴我如何讓這個腳本工作。我嘗試了幾個小時,我無法弄清楚它爲什麼失敗。無法使用蘋果腳本將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