Re: Menulet scripting
Re: Menulet scripting
- Subject: Re: Menulet scripting
- From: David Gregg <email@hidden>
- Date: Tue, 27 Jun 2017 02:46:59 -0600
Bob,
Depending on the menulet here are a few ideas:
1) Some provide a keyboard shortcut which you could trigger using System Events
or a macro app like Keyboard Maestro;
2) Some menulets can be seen using the UI Browser Screen Reader when it doesn't
appear in the UI Browser;
3) If you can't trigger the menulet directly, through using 2, then at least
you can get the position and size of the location of menu bar item.
tell application "System Events"
tell process "Dropbox"
-- Method 1 - Direct access
--(*
click menu bar item 1 of menu bar 2
--*)
-- Method 2 - Click at a point
(*
set {dropboxMenuItemX, dropboxMenuItemY} to position of menu
bar item 1 of menu bar 2
set {dropboxMenuItemW, dropboxMenuItemH} to size of menu bar
item 1 of menu bar 2
set dropboxMenuItemMidPointX to dropboxMenuItemX +
dropboxMenuItemW / 2 as integer
set dropboxMenuItemMidPointY to dropboxMenuItemY +
dropboxMenuItemH / 2 as integer
click at {dropboxMenuItemMidPointX, dropboxMenuItemMidPointY}
*)
end tell
end tell
The above ideas are to trigger the dropping of the menu from the menu bar. Then
depending on the app you will need to play with the various methods for
discovering how to trigger any further functionality. Again the UI Browser
Screen Reader usually also greatly helps with this aspect.
If you let me know which items you are after I may be able to help further.
> On Jun 27, 2017, at 1:36 AM, Bob Stern <email@hidden> wrote:
>
> Clarification: My question refers to a menulet (menu extra) installed by a
> faceless background application, not the menulets installed by OS X. I
> realize the latter can be scripted.
>
> Thanks again,
>
> Bob Stern
> _______________________________________________
> 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
_______________________________________________
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