Re: System Events 1.2 and Error messages
Re: System Events 1.2 and Error messages
- Subject: Re: System Events 1.2 and Error messages
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 26 Dec 2002 11:06:47 -0800
On 12/26/02 10:52 AM, "Barbara Mueller" <email@hidden> wrote:
>
> There's an 'enabled' property of menu item. Does it not work correctly?
>
>
>
> tell menu bar 1
>
> if enabled of menu item "Select All" of menu "Edit" then
>
> click menu item "Select All" of menu "Edit"
>
> say "I have selected everything"
>
> else
>
> say "The menu item is disabled"
>
> end if
>
> end tell
>
>
Unfortunately, this is working either.
>
>
The scripts stops at the word "enabled" and gives the following error message:
>
>
"NSCannotCreateScriptCommandError"
>
>
Any other ideas who to solve the problem?
Does 'enabled' work for menu items that are actually enabled? If so you
could use your try block on that statement:
tell menu bar 1
try
set ifEnabled to enabled of menu item "Select All" of menu "Edit"
then
if ifEnabled then
click menu item "Select All" of menu "Edit"
say "I have selected everything"
else -- will still work when 'enabled' can return false
say "The menu item is disabled"
end if
on error
say "The menu item is disabled"
end try
end tell
But if it doesn't even work for menu items which are enabled, then there's
nothing much to be done but report a bug. This is beta software, after all,
and is to be expected. It should be fixed before official release, and
reporting it will make sure that happens.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.