Posted on 02-29-2024 07:23 AM
Hello.
I'm trying to ensure teams is closed prior to updating app and getting errors when trying to force close it.
killall "Microsoft Teams (work or school).app"
Works fine with Classic teams i'm sure it's something about work or school part getting lost in code just don't know how to fix it.
Thank you for your time.
Solved! Go to Solution.
Posted on 03-01-2024 08:20 AM
Sorry I replied to wrong post
Thanks for pointing me in the right direction here is final script that worked
Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'
Remove the Teams work or School app
rm -rf //Applications/Microsoft\ Teams\ \(work\ or\ school\).app
02-29-2024 07:35 AM - edited 02-29-2024 07:36 AM
try AppleScript.. better than a kill: (you may need to change the name here, don't have teams)
#!/bin/sh
osascript <<EOF
try
tell application "Microsoft Teams"
quit
end tell
end try
EOF
Posted on 03-01-2024 08:20 AM
Sorry I replied to wrong post
Thanks for pointing me in the right direction here is final script that worked
Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'
Remove the Teams work or School app
rm -rf //Applications/Microsoft\ Teams\ \(work\ or\ school\).app
Posted on 02-29-2024 01:27 PM
If you are using Microsoft's Teams package, the preinstall script in the package will quit teams for you without you needing to do anything else.
Posted on 03-01-2024 07:35 AM
Thanks for replying. I do run the pkg but I've noticed since switch to the new teams version app crashes after install but if I fully remove the app then install seems to work better. I was able to script to remove the app just haven't figured out script to force close it as well.
Posted on 03-01-2024 08:15 AM
Thanks for pointing me in the right direction here is final script that worked
Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'
Remove the Teams work or School app
rm -rf //Applications/Microsoft\ Teams\ \(work\ or\ school\).app