• 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: match in a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: match in a list


  • Subject: Re: match in a list
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 19 Jul 2002 02:10:33 -0700

On Thursday, July 18, 2002, at 09:10 PM, Zimba wrote:

how can I write this the proper way:move (every file of theFolder whose
name ends with item in image_extension_list) to (folder "images" of
theFolder) with replacing
I'd like to avoid a loop to check if the name contains one of the
extension in the image_extension_list, is there a way?

There's no way to do the general case of that without a loop, as far as I know. However, since you're looking at the extension, you can cheat if you're using Mac OS X. The Mac OS X Finder defines a "name extension" property for items. You can therefore say something like this:

set image_extension_list to {"jpg", "tiff", "gif"}
tell theFolder
move every file whose name extension is in image_extension_list to folder "images"
end


--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >match in a list (From: Zimba <email@hidden>)

  • Prev by Date: import picture to FMP?
  • Next by Date: Re: Creator Types in OS X...
  • Previous by thread: match in a list
  • Next by thread: Re: match in a list
  • Index(es):
    • Date
    • Thread