Hi all
I'm trying to make a script that can use a parameter to check if an application is open, notify the user if it is, then quit the application, i've got the check and notify working with a parameter but i'm unable to get the quit app part working.
if i use the application name rather than the parameter the application quits ok, when using the parameter it does not, any pointers ?
works ok
/bin/launchctl asuser "$LoggedInUID" /usr/bin/osascript -e 'quit app "Microsoft Teams"'
does not work when using the Parameter
echo "Closing $4"
/bin/launchctl asuser "$LoggedInUID" /usr/bin/osascript -e 'quit app "$4"'
paging @mm2270 as i think i originally found the asuser approach from you !