[MacRuby-devel] Custom url scheme
Martin Hawkins
martin.hawkins at gmail.com
Mon Jan 10 10:47:52 PST 2011
Excellent Caio - thanks.
Now I've gone full circle and am getting
'AppDelegate::KInternetEventClass (NameError)
from /Users/martin/work/macruby/experimental/build/Debug/
experimental.app/Contents/'
Code is now:
framework 'Foundation'
# framework 'ApplicationServices' - it doesn't matter whether this
line exists or not
class AppDelegate
def initialize
registerExperimental
end
def registerExperimental
sharedAEManager = NSAppleEventManager.sharedAppleEventManager
sharedAEManager.setEventHandler(self,
andSelector: :"getURL:event:withReplyEvent:returnEvent:",
forEventClass:KInternetEventClass, andEventID:KAEGetURL)
end
def getURL(event, replyEvent)
if event.respond_to?(:paramDescriptorForKeyword)
url = event.paramDescriptorForKeyword(KeyDirectObject)
end
end
end
I don't understand why that error has resurfaced.
On Jan 10, 6:28 pm, Caio Chassot <li... at caiochassot.com> wrote:
> On 2011-01-10, at 15:52 , Martin Hawkins wrote:
>
>
>
> > Thanks Matt, I've got the book but missed that point.
> > Any suggestions re my second issue. i.e. translating the selector part
>
> You can pass a selector as a symbol or string:
>
> m.setEventHandler(self, andSelector: :"getURL:event:withReplyEvent:returnEvent:", …
> m.setEventHandler(self, andSelector:"getURL:event:withReplyEvent:returnEvent:", …
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-de... at lists.macosforge.orghttp://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
More information about the MacRuby-devel
mailing list