Followup to accessing the "enabled" property of menu items using UIScripting
Followup to accessing the "enabled" property of menu items using UIScripting
- Subject: Followup to accessing the "enabled" property of menu items using UIScripting
- From: Piers Goodhew <email@hidden>
- Date: Mon, 28 Apr 2003 16:28:20 +1000
I recently asked about this on the ASS/AS list (no response) and a
search of the AS-users archive shows that this functionality may well
be broken (at least in UI scripting 1.2 beta. I haven't done the
obvious thing and tried 1.1.1 yet).
I thought the following "hackround" may be of use to someone until a
fix is made - it's obviously a "Save"-item-only handler; and elegant
scripters might want to do version checks, use a Try block with the
proper syntax first, not release this widely; you'll probably want to
lose the "log" calls etc., etc.
Anyway the following works on a Ti667, X.2.4, ASS 1.2, SystemEvents.app
v1.2
-- checks the save menu of an app is enabled, without bringing it to
the front
-- Currently, this is a hackaround for the UI Scripting beta not
working. Need a version check or a fix before a wide release of this.
on isSaveMenuEnabled(appName)
log "isSaveMenuEnabled(" & appName & ")"
tell application "System Events"
tell process appName
set variable to (properties of menu item "Save" of menu "File" of
menu bar 1) as list
end tell
end tell
log variable as text
return item 10 of variable as boolean
end isSaveMenuEnabled
(Replies to me direct or the ASS/AS list, I'm not subscribed to
AS-users)
PG
_______________________________________________
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.