Add & remove menu bar items via script (not GUI)

Discussion in 'Mac Programming' started by CliftonHighgrov, Dec 4, 2014.

  1. CliftonHighgrov macrumors regular

    CliftonHighgrov

    Joined:
    Oct 1, 2014
    Location:
    United Kingdom
    #1
    Hi,

    I'd like to add & remove the Airport, Bluetooth and Time Machine menu bar icons using Automator. Anyone know of a way to do this without using GUI scripting?
     
  2. Pakaku macrumors 68000

    Pakaku

    Joined:
    Aug 29, 2009
    #2
    Bartender would accomplish that, but that's an app, not a script.
     
  3. CliftonHighgrov thread starter macrumors regular

    CliftonHighgrov

    Joined:
    Oct 1, 2014
    Location:
    United Kingdom
    #3
    Thanks for the reply. Nice idea, not sure if it would be suitable for my situation, and anyway $15 is too much.

    Thanks though.
     
  4. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #4
    You can add menu extras with the unix command "open."
    Example:
    Code:
    open /System/Library/CoreServices/Menu\ Extras/AirPort.menu
     
  5. CliftonHighgrov thread starter macrumors regular

    CliftonHighgrov

    Joined:
    Oct 1, 2014
    Location:
    United Kingdom
    #5
    That's actually useful, thanks. But how do I close them? I've checked Activity Monitor and ps in the Terminal, but can't find anything that looks right.
     

Share This Page