NSAppleScript in a mdimporter
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