• 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: [Newbie] What's wrong with my code ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie] What's wrong with my code ?


  • Subject: Re: [Newbie] What's wrong with my code ?
  • From: has <email@hidden>
  • Date: Tue, 27 Dec 2005 13:01:09 +0000

Eric Morand wrote:

>After a lot of years spent with Objective-C, I'm back to
>Applescript...and I've to confess that it is NOT that easy to return !!!
>
>In fact, I'm stuck with newbies problems (yes that's a shame). In
>particular, here is a snipet of code that doesn't work :
>
>	set aMenuItem to (make new menu item)
>
>	set (title of aMenuItem) to "Test"
>
>	display dialog (title of aMenuItem)
>
>Can anyone tell me what's wrong with this code ? I just can't see
>where I made a mistake.

I assume this is from a Studio project, in which case you'd be better posting to the AppleScript-studio list. But anyway, looks like you've forgotten to specify an insertion location for the new 'menu item' object in the 'make' command - see the 'make' command's 'at' parameter.

Remember, AS != ObjC. With application scripting, you always manipulate an existing application object model, not create application objects in isolation.

has
--
http://freespace.virgin.net/hamish.sanderson/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [Newbie] What's wrong with my code ?
      • From: Eric Morand <email@hidden>
  • Prev by Date: Re: [Newbie] What's wrong with my code ?
  • Next by Date: Re: [Newbie] What's wrong with my code ?
  • Previous by thread: Re: [Newbie] What's wrong with my code ?
  • Next by thread: Re: [Newbie] What's wrong with my code ?
  • Index(es):
    • Date
    • Thread