• 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
Service Menu Solved (BUT IT'S SLOW!!!)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Multiply defined symbols with optimization
  • Next by Date: Re: NSFileManager miscount
  • Previous by thread: Multiply defined symbols with optimization
  • Next by thread: Problem with using NSSavePanel's beginSheetForDirectory
  • Index(es):
    • Date
    • Thread