Hi All,
I have an application where I create an NSStatusItem on application startup.
I want to call Applescript when a menu option is choosen.
In Interface builder, I have a menu whos has a script defined.
When I add a menu option it gets an index of 1 and a scope Global. I then click on the Applescript tab and give it the name "RMCreate" and select my Applescript and I select that it should respond to 'choose menu item.
Then in AppleScript I have:
on choose menu item theObject
if the name of theObject is equal to "RMCreate" then
display dialog ("test")
end if
end choose menu item
So I am expecting that when I select that menu option that I get a dialog that pops up so I can verify i hit inside that conditional.
But instead I get an error:
AppleScript Error: Can't get <class menl> id 3 of item if 1 (-1728)
Can anyone tell me what this means and what I am doing wrong?
I thought I have done this before.
Leopard 10.5.3, XCode 3.0
-Jason