• 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: "Arthur J. Knapp" <email@hidden>
  • Date: Fri, 19 Jul 2002 09:48:54 -0400

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

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

If image_extension_list is dynamically generated in some way, then
you would have to use some manner of repeat loop. However, if these
extensions are known at compile-time, you can use multiple filters:

-- Line continuation characters removed:

-- Debug
--
set oldF to choose folder
set newF to choose folder

tell application "Finder"

move (every file of oldF whose
(name ends with ".gif") or
(name ends with ".jpg") or
(name ends with ".png")) to
newF with replacing

end tell


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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.

  • Prev by Date: Re: How do digest readers manage to participate?
  • Next by Date: duplicates in a file
  • Previous by thread: Re: match in a list
  • Next by thread: Launching application through web browser(netscape/IE)
  • Index(es):
    • Date
    • Thread