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

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


  • Subject: Re: Calling a nib item from AppleScript (and more..)
  • From: "Sutapalli Satyanarayana" <email@hidden>
  • Date: Mon, 02 Jun 2008 21:42:18 -0600

If u are using XCode and IB, did u select "Scriptable Application" or some other application while developing?

Thanks & Regards,
Satyanarayana SVV
Novell Software Development (I) Pvt. Ltd., Bangalore, India
9886555469 (mobile)



>>> "J. Todd Slack" <email@hidden> 6/3/2008 3:48 AM >>>
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

References: 
 >Calling a nib item from AppleScript (and more..) (From: "J. Todd Slack" <email@hidden>)

  • Prev by Date: Re: A bug (was Re: make new folder)
  • Next by Date: Re: Getting iPod Serial Number
  • Previous by thread: Re: Calling a nib item from AppleScript (and more..)
  • Next by thread: quicktime duration changes
  • Index(es):
    • Date
    • Thread