On Unix/Linux there are some tools such as
xprop to identify a window's PID by clicking on it, but they only work with X11.
Is there any similar solution for macOS? To get the process PID based on its visible window (e.g. once clicking on it)? Ideally invoked from the command line.