Get System Volume

I want to get the current volume settings then mute the volume.

After I am done with the app I want to reset the volume to the original setting.

Is there a way to get the current volume in Keyboard Maestro (similar to getting the current mouse position)?

I seem to be able to do this with AppleScript but I can't figure out how to save that value to a KM variable to use later.

I remember posting about this some time ago. Since I'm away from my Mac I'll refer you to the discussion:

It works on Mojave so YMMV but it demonstrates saving to KM variables...

Be sure you scroll down to Post #5 to see how to handle local and instance variables.

Also ā€“ keep in mind that you can set an AppleScript action to save the AppleScript result to a variable.

Thank you. The first part worked great out of the box but I was having trouble resetting the volume. After playing around a bit I found that removing the set vol as integer worked as I want it. I'm not sure why that is but I suppose since I am not changing the value it doesn't need to be converted to an integer anyway.