How to call this Cocoa method from AppleScript?
How to call this Cocoa method from AppleScript?
- Subject: How to call this Cocoa method from AppleScript?
- From: Satoshi Matsumoto <email@hidden>
- Date: Mon, 28 Feb 2005 16:53:11 +0900
Hi,
AppleScript Studio provides the "call method" command for calling methods of
Objective-C objects in an AppleScript Studio application like this....
set fontNames to (call method "availableFonts" of (call method
"sharedFontManager" of class "NSFontManager"))
Above AppleScript executes:
NSArray *anArray = [[NSFontManager sharedFontManager] availableFonts];
and store the result font name array into list variable "fontNames."
Then I want to sort the contents of "fontNames" list.
In Objective-C, I can sort an array like this.
NSArray *sortedArray =
[anArray
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
I have no idea to express the parameter "@selector(caseInsensitiveCompare:)"
in the "call method" format.
How to express the above Objective-C method in the "call method" format?
Thanks,
Satoshi Matsumoto
P.S. It is much more effective and easier for me to write objective-C code
than AppleScript Studio script.
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802
_______________________________________________
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