• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dumb Finder scripting question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dumb Finder scripting question


  • Subject: Re: Dumb Finder scripting question
  • From: Ed Stockly <email@hidden>
  • Date: Sat, 15 Dec 2007 13:57:09 -0800

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

=
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Dumb Finder scripting question
      • From: Michelle Steiner <email@hidden>
    • Re: Dumb Finder scripting question
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: Getting the time zone
  • Next by Date: making the Documents folder visible
  • Previous by thread: Re: Dumb Finder scripting question
  • Next by thread: Re: Dumb Finder scripting question
  • Index(es):
    • Date
    • Thread