Trigger when Microphone in use

Id love to be able to have a trigger for when an app is using the microphone.

This basically means im in a meeting so i can make lots of things happen.

One thing would be to set my Focus mode to meeting (I have an apple shortcut to do this and one to take it back out of meeting)

You could use the free oversight tool: Objective-See: OverSight
It allows you to trigger a terminal command when mic/cam is in use on macOS. You can use the shortcuts command line tool to trigger your shortcut (shortcuts run thenameofyourshortcut)

Such a trigger is on my todo list, but it's not easy.

You are quick! Much Appreciated!

I dont however seem to be able to run the shortcut like you said. it needs me to pick an application?

Ideally I also want it to run my "Meeting Started" script when mic is in use, and "Meeting Finished" when the mic is no longer in use.

Ah you are right. Here is an apple script you can use (based on How to use passed arguments in Apple Script - #3 by CK11 - AppleScript | Mac OS X - MacScripter), put it into a text file and save it as somename.applescript, then make sure it is executable via chmod +x somename.applescript
Then oversight can run it, make sure to enable the "pass parameters" option

#!/usr/bin/env osascript
use scripting additions
on run argv
	set {device, state} to {item 2, item 4} of argv
	if the device ≠ "microphone" then return false
	if the state = "off" then
		tell application "Shortcuts Events" to run the shortcut named "MicOff"
		tell application "Shortcuts Events" to run the shortcut named "MicOn"
	end if
end run

(This will trigger shortcuts named MicOff and MicOn, I'm attaching the script zipped to this post) (760 Bytes)

1 Like

That was perfect thank you!