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

Re: Selecting files in a list


  • Subject: Re: Selecting files in a list
  • From: "Bob.Kalbaugh" <email@hidden>
  • Date: Wed, 26 Mar 2003 20:20:10 -0500

on 3/26/03 2:37 AM, Wade Williams at email@hidden wrote:

> This is embarrassing, but it's driving me crazy.
>
> How can I select files in a folder from a provided list of filenames?
>
> I've tried:
>
> set theFiles to {"input.txt", "license.txt"}
>
> tell application "Finder"
> open folder "path:to:my:folder"
> set the selection to (files in theFiles)
> end tell
>
> which runs, but does not actually select the files.
>
> I've tried this 50 different ways, but have been unsuccessful in
> finding one that works.
>
> Thanks,
>
> Wade

The script below works for me. Hope it helps.

--
set theFiles to {"input.txt", "license.txt"}
set theFolder to "path:to:my:folder"
tell application "Finder"
open folder theFolder
select (files in folder theFolder whose name is in theFiles)
end tell

--
Bob.Kalbaugh
_______________________________________________
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: 
 >Selecting files in a list (From: Wade Williams <email@hidden>)

  • Prev by Date: Newbie Q on self-executing log app
  • Next by Date: Re: max script size
  • Previous by thread: Selecting files in a list
  • Next by thread: Saving property values over changes to script
  • Index(es):
    • Date
    • Thread