I've installed the Perian addon for Quicktime so it can open .flv files, and then I can save them as .m4v or .mov. I'm trying to make an Applescript to convert from .flv to .m4v automatically by using this tutorial and butchering their example applescript file, which normally converts ChemDraw files (.cdx, .cml, .mol) to .tiff, so that it instead uses Quicktime to save the .flv files as .m4v. When I try to use it, though, I get an error "QuickTime Player got an error: document 1 doesn't understand the save message". My save message is currently:

save first document in target_path as ".m4v"

which looks like the QuickTime dictionary's instructions:

save specifier : The document(s) or window(s) to save.

[as saveable file format] : The file format to use.

I've also tried "m4v", without the period, and still get the error.
Is my Save direction wrong, or is it probably an error from trying to use Quicktime instead of the original ChemDraw? I tried to change references to .cdx, .cml, .mol, .tiff, and ChemDraw to .flv, .m4v, and QuickTime respectively, but maybe it's more complicated than that?

I would, in fact, appreciate any example showing how to save an application file (ex: a TextEdit .rtf or .txt), as I can't seem to get any kind of file to save using applescript.


3 Answers 3


Sorry, still too low to post comment. Are we talking QuickTime Player X or QuickTime Player 7? (very different .sdefs)

Also, can you post the script content leading up tosave first document in target_path as ".m4v"? (tell blocks can be important, as well as knowing what value type target_path is, etc.)


I've only had to script Quicktime once, and that script is long gone, but I do remember that you actually the export command is really what you want if you want to convert formats. From the Dictionary

export v : Export a movie to another file; export document : the movie to export; in file : the destination file; using settings preset text : the name of the export settings preset to use

I remember opening a sample file, creating a preset, exporting the file, then using the name of the preset in the final script. But the key was to actually manually create and use the preset first.

There are a lot of places to get started with Applescript, but Quicktime is definitely not one of them, and hacking that tutorial isn't going to work without a lot of unnecessary effort. I recommend you further search for Applescript example specific to Quicktime as the API is a bit wonky and really weak in the current version (10.x, I believe), to be honest. I do know that Apple has a complete Quicktime Applescript example code collection buried on their site, but the link is no longer in my notes. Macscripter.net might offer up some practical examples as well.


If you're using QuickTime Pro 7, I believe it can only save natively in .mov. You do have the option to export to other formats, but saving is a different function, and is always .mov regardless of the codec used within.

See if you can save as .mov with your script. If you can, then you know that you need to change your code to use an export function. If you can't, then it's some other problem.

You must log in to answer this question.