Running a script when fast switching between users...

bkwendt

Bit poster
I am new to Mac and am looking for a way to run a one line script when fast user switching between accounts.

In short I need to suspend my Parallels virtual machine so it will properly share between users. This is the purpose of this script.

I tried to use a logout hook but it didn't work because I assume fast user switching is not considered a logout.

Any suggestions would be great, I assume this will be easy... I just don't see how to do it.

Thanks!
Barrett
 
Hi,

You may try to use prlctl binary for this purpose.
The Terminal command for suspending a virtual machine:

prlctl suspend ID|name

To get an ID of the virtual machine, please use "prlctl list -a" command without quotes.
There you may find an ID or you may use the name in quotes.

line can look like:

prlctl suspend "Windows 7"
 
Back
Top