Re: AppleScript for menu bar items



In article <1iboczo.1ruqhz01we1mmzN%danspam@xxxxxxx>,
danspam@xxxxxxx (Daniel Cohen) wrote:

Jolly Roger <jollyroger@xxxxxxxxx> wrote:

In article <1ibn68c.1bxuq341vd0iv2N%danspam@xxxxxxx>,
danspam@xxxxxxx (Daniel Cohen) wrote:

Gregory Weston <uce@xxxxxxxxxx> wrote:

In article <1ibn2jw.pksqly5nm2uwN%danspam@xxxxxxx>,
danspam@xxxxxxx (Daniel Cohen) wrote:

I know how to write an AppleScript to call an item from one of the
menus
of an application.

But I would like the syntax for calling an item from a menu bar
button.
Can anyone supply that?

Can you explain further what you mean? I'm not sure what a "menu bar
button" is. Heck with "sure;" I don't even have a guess.

I thought that was the official name, but maybe I am wrong.

I mean the things that appear on the right of the menu bar, that don't
change according to the application you are in. For instance, Volume,
Airport, etc. (both Apple items and third-party ones).

Those are "menu extras". AppleScript doesn't have access to them
directly.

What are you wanting to accomplish?

There are two things I and someone else would find useful. One is to
turn something on remotely, when the only on-off setting is via the menu
extra, the other is a menu extra that I want to run at login time, but
switch from enabled to disabled. Both are menu choices from the relevant
menu extra, and not easily done by other means.

Unfortunately, you still haven't answered the question.

What do you want to turn on remotely?

And what do you want to run at login time?

AppleScript does allow access to ordinary menu items (the ones each
application has) although it is slightly complicated. So I assumed it
would also have access to the extras, although with a different syntax.
But maybe not.

Nope. And that's a hack Apple added to AppleScript. AppleScript was
never designed to be a system UI macro language.

Again, what are you actually trying to accomplish here? Forget menus
and so on - what is it you are actually trying to do?

--
Note: Please send all responses to the relevant news group. If you
must contact me through e-mail, let me know when you send email to
this address so that your email doesn't get eaten by my SPAM filter.

JR
.



Relevant Pages

  • Re: AppleScript for menu bar items
    ... But I would like the syntax for calling an item from a menu bar button. ... etc. (both Apple items and third-party ones). ... AppleScript does allow access to ordinary menu items (the ones each ...
    (comp.sys.mac.system)
  • AppleScript for menu bar items
    ... I know how to write an AppleScript to call an item from one of the menus ... But I would like the syntax for calling an item from a menu bar button. ...
    (comp.sys.mac.system)
  • RE: Index Popup
    ... 'Adds a new menu to menu bar ... leads to sub sub menu headings of "Apple1 and Apple2" When these are clicked ... How to customize menus and menu bars in Excel ... Visual Basicfor Applications code to customize menus in Microsoft Excel ...
    (microsoft.public.excel.programming)
  • Re: English-like Python
    ... The big advantage of AppleScript syntax is that it makes it easy to ... command name, a command name followed by a property/constant/variable ... With more conventional language syntaxes, ...
    (comp.lang.python)
  • some corrections Re: The Fundamental Problems of Lisp
    ... syntax, which can be used to comment out well-formed S-expressions ... M-expressions make an extensive appearance in John Allen's ...
    (comp.lang.lisp)