Filtering files in NSOpenPanel that NSAppleScript can run
Filtering files in NSOpenPanel that NSAppleScript can run
- Subject: Filtering files in NSOpenPanel that NSAppleScript can run
- From: "Sean McBride" <email@hidden>
- Date: Thu, 16 Nov 2006 13:32:32 -0500
- Organization: Rogue Research
Hi all,
I'd like to allow users to select an arbitrary AppleScript that my app
will in turn run.
NSAppleScript has initWithContentsOfURL:error: which is perfect for
this. But what kind of files will it accept? The docs say "either text
or compiled form" but in Script Editor's 'save as' I count 5 formats.
Is there a way to display an NSOpenPanel that will allow the user to
select only files that initWithContentsOfURL:error: can deal with?
Something akin to [NSBitmapImageRep imageFileTypes].
There appear to be no UTIs for AppleScript. The only thing I can think
of is to preflight each file by calling initWithContentsOfURL:error: and
see if it fails (likely slow) or hardcoding the 5 extensions that
today's Script Editor can save (not future-proof).
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden