I’m comfortable with programming but don’t know Applescript, I’ve searched this forum and tried the books with no luck so here’s my (simple?) question…
I want to put a button on my top menu bar that mutes/un-mutes audio when I click on it.
Could any kind folk point me in the right direction please?
the easiest way is to press F10 (or fn F10)
It is not possible to create a StatusMenuItem on the main menu bar with AppleScript.
This requires some Objective-C code
Thank you for replying Stefank. Unfortunately that is not an option as I’ve had to disable the function keys due to the Apple Remote Control bug interfering with Logic studio. (thats a long story!).
As a menulet has no GUI and you want to change the volume level by clicking on the menu item,
Mute.app can be terminated only by Terminal.app or Activity Monitor.app
Hi stefan, many thanks for doing this. I really appreciate it.
I built and ran it and and the icon appears in the menu, I can click on it and the volume goes to zero. So it looks close to what I need, but I notice it doesn’t acutely mute the sound but I think sets the volume to zero? Is it possible to change this to just toggle mute on/off? I ask since there is actually a difference between zero volume and mute on/off.
So far I haven’t figured out how to make it a stand alone app from xcode, as I’d like, when its finished, to have it as a log-in item. I’ll investigate xcode as to how to do this. I assume its some sort of compile command?
I guess there’s some sort of apple cocoa reference I can use to find the mute command?
I haven’t looked at the CoreAudio.Framework, so like Stefan said, there is probably a way to do it from there as well. Also, the CoreAudio implementation will be faster. There will be a slight delay using the AppleScript version.
Thanks Guys, I need to explain; its a couple of decades since I programmed and that was in C and on PCs so Im a complete novice on macs, so craig I understood what you wrote but have no idea what to do with it!
But thank you anyway. I do appreciate it.
Perhaps someone could point me at a really good beginners tutorial (preferably video based)?