QuickTime Player 7 export fails with the error ...

… «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

Any ideas of what could go wrong?

Model: MacBook Pro 9,1 (mid-2012 15") Core i7 2.3 GHz, 16 GB RAM, 1TB SSD
AppleScript: 2.7
Browser: Safari 605.1.15
Operating System: macOS 10.14

  1. Exporting documents and using presets is job of application and not of document. Put it inside the correct tell block and use correct syntax

export document 1 to …

  1. file coercion should make the app itself and not you. You should only provide it with HFS path and in the export command put

file HFSpath

scrutinizer82’s syntax is nominally correct, AppleScript-wise. The target of the ‘tell’ statement is the default target of the export command. I get the same error using either syntax, but don’t have QuickTime Player 7 Pro, so I can’t investigate further. The expression using settings preset “Movie to MPEG-4” looks like a specification for a particular settings preset, which would make it an ‘element’. Something seems to think it should be a ‘property’. :confused:

Problem solved.

Solution:

  1. Use POSIX path, not file reference as a path string after the POSIX file specifier

  2. [format]using settings preset[/format] doesn’t work and is a misleading entry in the QTP 7 dictionary. Use [format]use settings[/format] instead.