Pages

Wednesday, January 30, 2013

Cannot Understand Event Earsffdr Cocoa-Applescript

Hello Guys,

I'm trying to just write a little X-code 4 app to display it's own directory, using Cocoa-Applescript. I've created a window under MainMenu.xib, and linked it to my code in AppDelegate.applescript. My code looks something like this:

 

on myButtonHandler_(sender)

        set theFolder to POSIX path of (the path to current application)

        set theFile to theFolder & "/Contents/Resources/Dir.app"

        display dialog (the path to me)

        return void

    end myButtonHandler

 

 

The app builds perfectly, but when I click the button, it says:

 

 

[AppDelegate myButtonHandler:]: «script» doesn’t understand the «event earsffdr» message. (error -1708)

 

I have no idea what is happening there, so any help is appreciated!

 

P.S This code also works perfectly in Applescript Editor, but I want it to look better with a window, so this is really weird.


View the original article here

0 comments:

Post a Comment