If you need the PID for all processes with the same name, this inline function should work:
using System.Diagnostics;
public class VAInline
{
public void main()
{
Process[] processes = Process.GetProcessesByName("Discord");
for (int i = 0; i < processes.Length;i++)
{
VA.SetInt("~process" + i, processes[i].Id);
}
}
}
It'll create an integer variable for each processes found, starting at 0 (E.G. "~process0", "~process1", "~process2", and "~process3").
A slightly more advanced command could use a loop to apply the volume setting to each process (rather than using four different "Set Audio Level" actions), without having to specify the amount of processes (in case there are more or fewer than four at some point).
E.G.
Inline C# Function: Get PIDs, wait until execution finishes
Start Loop : Repeat From 0 to [{INT:~totalProcesses}]
Toggle mute for application [{INT:~process{INT:~i}}] audio
End Loop
Where "Get PIDs" contains
using System.Diagnostics;
public class VAInline
{
public void main()
{
Process[] processes = Process.GetProcessesByName("Discord");
for (int i = 0; i < processes.Length;i++)
{
VA.SetInt("~process" + i, processes[i].Id);
}
VA.SetInt("~totalProcesses", processes.Length - 1);
}
}