-- ==================================================================
-- FFmpeg Edit.app v1.3
-- ==================================================================
#set theicon to alias ((path to me as text) & "Contents:Resources:applet.icns")
on savePlist(FFmpegPath, GlobalOptions, InputOptions, OutputOptions, OutputFormat)
set plistfile_path to ((path to documents folder as string) & "FFmpeg Edit.plist")
tell application "System Events"
set the parent_dictionary to make new property list item with properties {kind:record}
set this_plistfile to make new property list file with properties {contents:parent_dictionary, name:plistfile_path}
make new property list item at end of property list items of contents of this_plistfile with properties {name:"FFmpegPath", value:FFmpegPath}
make new property list item at end of property list items of contents of this_plistfile with properties {name:"GlobalOptions", value:GlobalOptions}
make new property list item at end of property list items of contents of this_plistfile with properties {name:"InputOptions", value:InputOptions}
make new property list item at end of property list items of contents of this_plistfile with properties {name:"OutputOptions", value:OutputOptions}
make new property list item at end of property list items of contents of this_plistfile with properties {name:"OutputFormat", value:OutputFormat}
end tell
end savePlist
tell application "System Events"
set filepath to ((path to documents folder as string) & "FFmpeg Edit.plist")
set p_list to property list file (filepath)
set FFmpegPath to value of property list item "FFmpegPath" of p_list
set GlobalOptions to value of property list item "GlobalOptions" of p_list
set InputOptions to value of property list item "InputOptions" of p_list
set OutputOptions to value of property list item "OutputOptions" of p_list
set OutputFormat to value of property list item "OutputFormat" of p_list
end tell
set {text returned:FFmpegPath} to (display dialog "FFmpeg Path:" default answer FFmpegPath buttons {"Abort", "Save"} with title "FFmpeg Edit") # with icon theicon)
if the button returned of the result is "Save" then
savePlist(FFmpegPath, GlobalOptions, InputOptions, OutputOptions, OutputFormat)
end if
set {text returned:GlobalOptions} to (display dialog "Global Options:" default answer GlobalOptions buttons {"Abort", "Save"} with title "FFmpeg Edit") # with icon theicon)
if the button returned of the result is "Save" then
savePlist(FFmpegPath, GlobalOptions, InputOptions, OutputOptions, OutputFormat)
end if
set {text returned:InputOptions} to (display dialog "Input Options:" default answer InputOptions buttons {"Abort", "Save"} with title "FFmpeg Edit") # with icon theicon)
if the button returned of the result is "Save" then
savePlist(FFmpegPath, GlobalOptions, InputOptions, OutputOptions, OutputFormat)
end if
set {text returned:OutputOptions} to (display dialog "Output Options:" default answer OutputOptions buttons {"Abort", "Save"} with title "FFmpeg Edit") # with icon theicon)
if the button returned of the result is "Save" then
savePlist(FFmpegPath, GlobalOptions, InputOptions, OutputOptions, OutputFormat)
end if
set {text returned:OutputFormat} to (display dialog "Output Format:" default answer OutputFormat buttons {"Abort", "Save"} with title "FFmpeg Edit") # with icon theicon)
if the button returned of the result is "Save" then
savePlist(FFmpegPath, GlobalOptions, InputOptions, OutputOptions, OutputFormat)
end if