Re: wildcard for directory selection
Re: wildcard for directory selection
- Subject: Re: wildcard for directory selection
- From: Matthew Galaher <email@hidden>
- Date: Tue, 8 Jul 2003 12:51:16 -0700
That's it. Thank you!
On Tuesday, July 8, 2003, at 11:42 AM, Christopher Nebel wrote:
On Tuesday, July 8, 2003, at 8:49 AM, Matthew Galaher wrote:
I wish to be able to type the first x number of characters in a file
name in a dialog, and then have the finder select/open the first
match. So if I have directories named:
Volumes/Production/client/content/0073_foobar
Volumes/Production/client/content/0074_barfoo
Volumes/Production/client/content/0075_foobar
the dilalog would only need '0075' to open directory 0075_foobar
Is this something that would be best to have Applescript talking to
terminal.app?
That's one way. The more normal way, from AppleScript's point of
view, is to use the Finder's object model of the file system:
-- get the prefix from the user
display dialog "Give me a prefix:" default answer "0075"
set p to text returned of the result
-- the business end.
tell application "Finder"
open first item of folder "Production:client:content:" whose name
starts with p
end
If you wanted to restrict it to files, say "first file" instead of
"first item."
--Chris Nebel
Apple Development Tools
_______________________________________________
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.