… «The specified object is a property, not an element»
Hello,
I tried to export a movie in QuickTime Player 7 and got this error message. There’s only the class “document” as a top-level document element, not “movie”, so object model reference concerns don’t apply. I’m puzzled. My script is very simple.
property MovieTitle : ""
property Ext : {".mov", ".mp4", ".aif", ".aiff", ".mp3", ".m4a", ".avi", ".wav", ".wave", ".wv"}
property ExportPath : POSIX path of (path to movies folder)
tell application "QuickTime Player 7"
tell document 1
set MovieTitle to name
set AppleScript's text item delimiters to Ext
set MovieBaseName to text item 1 of MovieTitle
set DocumentPath to (POSIX file (ExportPath & MovieBaseName & ".mp4")) of me
export to DocumentPath as MPEG4 using settings preset "Movie to MPEG-4" with replacing
end tell
end tell
Every time I add the optional parameter [format]using settings preset[/format] it chokes with this error (it doesn’t when it’s absent but then I don’t get to use a preset I want to). I tried to direct this command to the top-level app object, to the video-track to no avail. Googling found me experimenting with references: I used file path:to:file instead of POSIX file path:to:file and still had that error returning only that was a coercion error -1700 [format]can’t make document "hotbabe.p4" of application "QuickTIme Player 7" into the specified type"[/format] . I don’t understand what “specified object” is the offender?
Model: MacBook Pro 9,1 (mid-2012 15") Core i7 2.3 GHz, 16 GB RAM, 500 GB SSD
AppleScript: 2.7
Browser: Safari 605.1.15
Operating System: macOS 10.14