• 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
Filtering files in NSOpenPanel that NSAppleScript can run
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Filtering files in NSOpenPanel that NSAppleScript can run
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: New bindings for NSArrayController
  • Next by Date: Re: Re: [SOLVED] Why doesn't CFDictionaryContainsKey() work?
  • Previous by thread: Re: Re: New bindings for NSArrayController
  • Next by thread: Re: Filtering files in NSOpenPanel that NSAppleScript can run
  • Index(es):
    • Date
    • Thread