Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vinner2112

macrumors newbie
Original poster
Feb 15, 2011
4
0
hiiiiiiii....

i'm ne to the xcode development environment and m developing the spotlight plugin for actionscript(.as) files and i hv developed all the code and debug it with the help of terminal.

when i debug the plugin from terminal using the command :

mdimport d2 <path of the .as file>

it successfully imports the asctionscript.mdimporter.

but when i start searching the contents from the spotlight the .as file will not displayed in the list of finder....

m attaching the needed files...pls verify if have any problem wid dem.

please help me....
 

Attachments

  • actionscp.zip
    5.7 KB · Views: 71
That code is importing a StickiesDatabase file. Did you upload the right code?
 
No...these files are of .as plugin

i have pasted the code from the stickies sample plugin...
but info.plist and schema.xml are modified files...

please resolve the problem if any...


thanks as always...
 
You still need to modify the code in the .m file to extract the metadata from the file. You can't do it simply by editing the plist or xml files - those just describe information about the plugin.
 
Spotlight Plugin not working

i have mde the following changes to the .m file and it changes the metadata but while perform search through the finder it doesn't show the file in the finder..


the code as follows:

Code:
Boolean GetMetadataForFile(void* thisInterface, 
						   CFMutableDictionaryRef attributes, 
						   CFStringRef contentTypeUTI,
						   CFStringRef pathToFile)
{
	NSData *data;
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
	
	// load the data from the file
	data = [NSData dataWithContentsOfFile:(NSString *)pathToFile];
	if (data == NULL) {
		NSString *filesContent = [[NSString alloc] initWithContentsOfFile:@"/users/vinay/desktop/basicfunctions.as"];
		[filesContent writeToFile:@"/mylog.txt" atomically:YES];
		[pool release];
		return FALSE;
    }
	//NSString *s1=(NSString *)pathToFile;
	//[attributes setValue:s1 forKey:(id)kMDItemDisplayName];
	
	CFDictionaryAddValue(attributes, CFSTR("public_archive_applesingle_Title"),@"ActionScript File");
	
	
	[pool release];	
	return TRUE;
}

thanks as alwayz...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.