• 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
NSAppleScript in a mdimporter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAppleScript in a mdimporter


  • Subject: NSAppleScript in a mdimporter
  • From: Romain Brestac <email@hidden>
  • Date: Wed, 1 Jun 2005 13:47:50 +0200

I am writing a spotlight importer for applescript files.
Inside the GetMetadataForFile() function, I try to read the script with this:


NSURL *fileURL = [NSURL fileURLWithPath:pathToFile] ;
NSAppleScript * script = [[NSAppleScript alloc] initWithContentsOfURL:fileURL error:&err];


When I try to force spotlight indexing on a script file, I get an error *-1750* in the err dictionary and the debug log says that *script* is NULL . The same code with the same script file works in a foundation tool project. Other NSAppeScript initialization methods (like initWithSource:) also work so the problem is specific to initWithContentsOfURL.

I suppose this is a problem with threading because NSAppleScript methods must be called in the main thread.

Is there a known issue in spotlight related to this ?
Thanks. Romain.


_______________________________________________ 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: NSAppleScript in a mdimporter
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Pasteboard inspector?
  • Next by Date: Halo around NSTextField
  • Previous by thread: Re: Pasteboard inspector?
  • Next by thread: Re: NSAppleScript in a mdimporter
  • Index(es):
    • Date
    • Thread