QT7 applescript

Hi,

Any idea what changes in QT7 are affecting this . . .

This is part of an existing droplet . . . this portion of the app should play the sound file(s) selected. It works fine with QT6 Player, but with QT7 it chokes on the line near the end “set audiotrack to track 1 of doc_ref”

I don’t see any changes in the dictionary that are giving me any clues!?

TIA,
jim


property extension_list : {"wav", "snd", "aif", "aiff", "mp3", "mp4", "aac", "m4a"}
property file_type_list : {"MooV", "AIFF", "sd2f"}
property file_creator_list : {"sd2a"}
global the_info
global the_type
global the_creator
global the_filesize


on run
        open {choose file}
end run

on open the_files
        repeat with this_file in the_files
                set the_info to info for this_file
                set the_extension to (name extension of the_info)
                set the_type to (file type of the_info)
                set the_creator to (file creator of the_info)
                if the_extension is in extension_list or ¬
                        the_type is in file_type_list or ¬
                        the_creator is in file_creator_list then
                        process_this_file(this_file)
                end if
        end repeat
end open

on process_this_file(this_file)
        tell application "QuickTime Player"
                launch
                set doc_ref to open this_file
                
                set audiotrack to track 1 of doc_ref
                play doc_ref
        end tell
end process_this_file

in case it helps someone else, here is a response I got elsewhere . . .

The issue here is that Cocoa scripting does not appear to return an object reference when handling the “open” command. I have confirmed the same behavior with TextEdit.

One workaround is to replace the line:

    set doc_ref to open this_file

with:

    open this_file
    set doc_ref to first movie