• 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
Calling a nib item from AppleScript (and more..)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calling a nib item from AppleScript (and more..)


  • Subject: Calling a nib item from AppleScript (and more..)
  • From: "J. Todd Slack" <email@hidden>
  • Date: Mon, 2 Jun 2008 15:18:53 -0700

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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Calling a nib item from AppleScript (and more..)
      • From: "Sutapalli Satyanarayana" <email@hidden>
    • Re: Calling a nib item from AppleScript (and more..)
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: background color
  • Next by Date: quicktime duration changes
  • Previous by thread: Re: Variables and command-line args
  • Next by thread: Re: Calling a nib item from AppleScript (and more..)
  • Index(es):
    • Date
    • Thread