Service Menu Solved (BUT IT'S SLOW!!!)
Service Menu Solved (BUT IT'S SLOW!!!)
- Subject: Service Menu Solved (BUT IT'S SLOW!!!)
- From: "Daniele M." <email@hidden>
- Date: Tue, 11 Mar 2003 22:58:16 +0100
- Organization: westcode software, inc.
Hi,
I have solved my problem with service (i need to use the
"NSFilenamesPboardType" string into the NSService of the plist file).
But now there is a problem... the code i slow... I need to execute an
applescript that return the selected files from Finder.
The code is this:
NSString *source = @"tell application \"Finder\"
set blah to selection
set x to length of blah
set results to \"\"
repeat with y from 1 to x
set bar to item y of blah
set results to (results & (bar as string) & \",\")
end repeat
return results
end tell";
NSAppleScript *AS = [ [NSAppleScript alloc] initWithSource: source];
NSDictionary *errorDictionary = nil;
NSString *path = [[AS executeAndReturnError:&errorDictionary]
stringValue];
NSLog(@"%@",path);
[AS release];
To execute this code the computer takes about 6/7 seconds... where is
the problem? Is there another method to do this increasing the
performances?
Thank you to all.
Daniele
+-----------------------------------------------------------------------
-------+
Daniele Margutti private mail: email@hidden
Westcode Software Inc. work mail: email@hidden
+-----------------------------------------------------------------------
-------+
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.