Basically, I want a way to hard code a “choose file name”. For the life of me though, I can’t figure out how to get a reference to a non-existant file.
How exactly are you supposed to specify output file names for various scriptable applications? All I want is to save a quicktime file–though, I can’t find anything other than “choose file name” that the “export to” for quicktime will allow.
I’m also unable to get export to work and it was working not too long ago. Maybe it was the upgrade to QT 6.3 that broke something. FYI, I’m running OS X 10.2.6, QT 6.3 (not QT Pro). I wonder if Apple has finally cut off Pro features that have been available via AppleScript even when Pro wasn’t purchased. Do you have QT Pro?
I have QuickTime Pro so I’m not sure if it’s the same in QuickTime but for me, the “export” command requires a reference and a class for the exported file. Thus, the following script works for me saving to a non-exisitent file:
I’m not using QuickTime pro. I’,m using QT 6.3 and OS 10.2.6 also. The following worked for me:
set desk_path to (path to desktop) as string
set file_spec to (desk_path & “New File”) as file specification
set file_ref to (choose file of type “AIFF”)
tell application “QuickTime Player”
tell front movie
export front movie to file_spec as MPEG4
I hadn’t tried AIFF to MPEG4 yet and it sounds pretty good. Went from 21MB to 2 MB. I always get caught after not scripting QuickTime for a long time on the export type. Note that MPEG4 is not in quotes. Can’t think of anything else that could cause your error. I forget what type of error you had while writing this post so I might write back.
Follow-up: I just happened to have the opportunity to download a very cool movie  and I was able to export it as QT movie just fine. I must have been using some bad movie files to test with earlier. :?
 The movie, available for download from this MacUpdate page, shows how “Unstoppable Progress” works. Unstoppable Progress is a neat hack created for a contest at this years MacHack conference. Very cool! Watch the movie! 8)
I’ve found when having difficulty such as wintermute and Rob mentioned in setting a ‘non-existent’ file reference, opening the file for access, then closing it again pretty much guarantees that the subject app can find it.
set the_file to ((the desktop) as text) & “File”
open for access file the_file
close access file the_file
Rob may remember a bug in GraphicConverter that produced a similar problem. This provided a workaround.