>>>>>So here's my finished script, which converts all the AVI movies saved from my Flip Video camera into QuickTime movies. It worked fine:
Works on my mac too. I didn't realize that entire contents is fixed.
tell application "Finder" set aviFiles to (get files of entire contents of folder (docPath & "My Flip Video Library") whose name extension is "avi")
Reminds me of one other thing to add to my Christmas wish list for AppleScript.
"as alias list" should be fixed. Currently if there is only one item in the directory it returns an error.
It should return a list containing one alias
There are a few other cases where the finder and other apps return a reference if only one item is in the result and a list if multiple items are. In each case they should return a list of one or more items.
Some annoyances - e.g. after the "save self contained" call, the name of the document changes, invalidating the document reference, so "close doc" won't work. I have to use "document newname", which means I have to construct the new name without the full path as well as with it...
Hmmm, this works on my mac.
if (count of toConvert) > 0 then tell application "QuickTime Player" repeat with aviURL in toConvert set doc to first item of (open location aviURL) set pathName to (get path of doc) as text set movPath to (text 1 through -5 of pathName) & ".mov" save self contained doc in POSIX file movPath close doc end repeat end tell end if
But, even if it didn't work, why should it annoy you? You're written the script, you've solved the problems, you can save it as a handler, you can reuse it without having to retype it everytime (this isn't terminal). You've even done it without using text item delimiters (for whatever reason). Problem solved, lesson learned. (Again, comments directed not so much at you, but more for general consumption).
ES
=
|