Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSReceiverEvaluationScriptError: 4 (1) ==> another issue



Adrian,

Thanks for your suggestions.

What happens if you refer to the menu item by name? As in:

set title of menu item "myOwnMenuItem" of sub menu of menu item
"firstMainMenuItem" of main menu to myOwnTextVariable

I didn't try it. I wasn't aware that providing names to each menu item was an option. I'll give it a try and see what happens.



An NSReceiverEvaluationScriptError: 4 usually occurs when an element
you are referring to can not be found. In such cases I always try to
get to the bottom of things like this:


I did wrap parts of the code in a try block, and that seemed to be fine to hide the error. The main problem that then resulted is when the user tried to select a menu since I had code along the lines of:
------
on choose menu item (theObject)


if theObject is equal to menu item 1 of menu item 3 of.....
     then....
end if

end choose menu item
------

This also created errors and prevented the user from being able to choose an option from the menu (the user was still able to select the option via a button on the window, however).

When I can find more time I'll try your suggestions. If I have any successes I'll report them back to this list.

Thanks for your help.

David H.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.