Re: NSAppleScript in a mdimporter
Re: NSAppleScript in a mdimporter
- Subject: Re: NSAppleScript in a mdimporter
- From: Daniel Jalkut <email@hidden>
- Date: Wed, 1 Jun 2005 09:18:48 -0700
Hi Romain - I won't be much help, but let me just say:
I also tried to make an mdimporter that loads an AppleScript file,
and ran into the same types of problems you are.
It was discussed in one of the other lists and somebody astutely
observed that it's not practical to load AppleScripts from an
mdimporter, because doing so might cause the Application whose
dictionary is being targeted to be launched.
This was enough to convince me that it wasn't an oversight that Apple
omitted AppleScripts from the metadata store, but actual hurdles that
I am resigned to letting Apple solve, now.
Daniel
On Jun 1, 2005, at 4:47 AM, Romain Brestac wrote:
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:
sweater.com
This email sent to email@hidden
_______________________________________________
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