Re: Open Dialog via filename extension?
Re: Open Dialog via filename extension?
- Subject: Re: Open Dialog via filename extension?
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 28 Dec 2003 01:38:18 -0800
On 12/27/03 9:34 PM, "Gary Lists" <email@hidden> wrote:
>
Walter Ian Kaye wrote [12-27-03 3:54 AM]:
>
>
> Is there any way to, e.g., show only 'osas' and *.scpt files?
>
>
A file with '.scpt' should be an 'osas' file, just as a file with '.txt'
>
should be a 'TEXT' file, no?
>
>
However, couldn't you just use the "name extension" property of "get info"?
>
(This is not available in OS9, but it seems to be available in OSX, at least
>
according to the Apple web pages, as part of the "essential subroutines"
>
posted here: <http://www.apple.com/applescript/guidebook/sbrt/>
>
>
Specifically, see the Finder Droplets handler for a sample usage of this
>
property.
You could give boo some credit for knowing what he's talking out, Gary.
And why did you remove his actual question:
>
I don't understand why Apple added filename extensions to OS X
>
without first updating things like 'choose file' to let us filter on
>
extensions as well as file type.
'choose file' - see that? What's 'choose file' have to do with the Finder?
Even in OS 9? Here's the latest AS 1.9.3 Standard Additions definition in OS
10.3.2:
choose file: Choose a file on a disk or server (defined in:
StandardAdditions.osax)
choose file
[with prompt - string] -- a prompt to be displayed in the file
chooser
[of type - list of string] -- restrict the files shown to only
these file types
[default location - alias] -- the default file location
[invisibles - boolean] -- Show invisible files and folders?
(default is true)
[multiple selections allowed - boolean] -- Allow multiple items to
be selected? (default is false)
Result: alias -- to the chosen file
That means you can write:
choose file of type {"osas", "TEXT"}
etc. Do you see 'of file name extension' anywhere? That's precisely what boo
is asking about.
If you're not aware of it, file types are not required in OS X. Furthermore,
Apple is "setting the example" here. I don't know of a single new Apple
Cocoa app (TextEdit, iCal, etc.) that assigns a file type to the files it
creates. That used to include the carbon Script Editor (1.9) in OS X, I
believe. The scripts it made have a .scpt file extension, but they do not
have "osas" file type. They have no file type, if I remember correctly.
All of a sudden, I see that Script Editor 2.0 _does_ assign "osas" file
type, I've just noticed. Good move by the AppleScript team - if contrary to
all other Apple apps. That's good news if you happen to be wanting 'choose
file' to find a script made by SE 2.0. (I wonder if boo is aware of that?)
But it won't find scripts made a few months ago to a few years ago by SE 1.9
(or 1.7 in OS X). And there's no way to specify .txt files made by TextEdit
(unless you assigned "TEXT" file type yourself in the Finder): they have
'missing value' as file type so they will be dimmed and unselectable using
line above.
--
Paul Berkowitz
_______________________________________________
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.