Issue Between Mic Drop and the %SystemVolume% Token

Hey @peternlewis, I have a weird issue that cropped up recently relating to the %SystemVolume% token. I use Mic Drop to control my microphone, and I noticed as soon as I make use of the %SystemVolume% token, whether in an action that provides real-time feedback or the Value Inspector, if Mic Drop is running, the KM Engine slows down, and sometimes becomes unresponsive. I also sometimes lose my audio input at the same time.

I believe this is more related to Mic Drop, since it started with one of their recent version updates. I am in contact with Matt over at Mic Drop to see what his thoughts are on it, but I wanted to reach out here and ask if you could think of any reason why this particular token might cause issues.

Any insight is appreciated.

-Chris

The action is straight AppleScript:

if output muted of (get volume settings) then
    return 0
else
    return output volume of (get volume settings)
end if

So if that is going slow, something is wrong with either AppleScript, interprocess communication related to AppleScript, or something related to retrieving the volume.

I guess he could launch the macOS app "Shortcuts" which has a "Run AppleScript" action and insert that code there. If the problem persists, that backs up your conclusions.

I tried it myself, and the code runs quickly and provides the correct result.

Could also just run the code in Script Editor.

Hmmm... thanks for the info @peternlewis and suggestion @Airy... I really don’t think it’s KM in this case, as none of my AppleScripts (and I have a lot of them dispersed throughout my macros) have any issues. Sounds like it is something related to Mic Drop itself. Thanks again!

If you can try the script above in Script Editor, and it has the same issue, then that would be something to report to the developer since it removes any potential implication of Keyboard Maestro in it and would be easier for the developer to test.

1 Like

Thanks again Peter, running it in Script Debugger causes no issues, so it must be something else going on.

Hey @peternlewis I realized I likely misunderstood your last comment... I have ran that script in Script Debugger probably 100 times at different points of the day today, without any issue.

On top of that, if I use that AppleScript or another, similar one (such as the example below) in an if action with the Show Results enabled, it causes the same issue.

So it appears the problems only arises when using the %SystemVolume% token, or an AppleScript that interacts with the sound settings from within Keyboard Maestro.

Any ideas how this might correlate to the issue I’m seeing?

Sample AppleScript that also causes issues:

output muted of (get volume settings)

I tried that script in KM, and I didn't have any problems/delays.

Try using the osascript tool in the Terminal and see if that behaves the same way.

Running it from osascript in Terminal causes the issue, namely Mic Drop appears to “reload” the available audio sources (from what Matt over there has shared with me). Sounds more and more like it might be on their end.

1 Like

Good, that gives a nice, easily reproducible issue, without any third party involvement, which as a developer should be very helpful for them.

1 Like

Indeed! I sent Matt that info (and a link to the post here for context) and he said he would look into what is causing it. Thanks @peternlewis and @Airy for yall’s help!

1 Like