-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible improvements? #3
Comments
Hi Graham, Thanks for your report!
I understand the issue… I was doing an exit(1) thinking this would use the exit code "1"… but this is not recommended. I see "1" on my Mac, though.
Looks like I wasn't clear enough in the doc for this one :) Does it makes sense? I really like your script. I will add it to the repo if that's ok? |
Ah, yes I see. Like Google Drive etc. Interesting, I hadn't thought of that. I could add some logic to the script so that if parameter 5 is filled in, and differs from the app bundle ID, then use parameter 5 instead.
Yes go ahead with the script!
Cheers, Graham
Von meinem iPhone gesendet
… Am 15.03.2017 um 15:36 schrieb Francois Levaux-Tiffreau ***@***.***>:
Posted http://stackoverflow.com/questions/42812244/swift-how-to-exit-a-macos-app-with-an-exit-code
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hey ftiff,
We're using this app a lot: thanks! A couple of things I've come across using this app:
If the app you are trying to close doesn't exist, it spits out error 132. I think it should exit 0, since there is no problem if there is no running app to close :) I added a check in our run script to account for this.
I don't know if you would like to include this in the app itself, but you can determine the required AppBundleID for an application using PlistBuddy, so no need to manually find it out. See below.
We package the unmodified app to install to
/Library/Application Support/JAMF/bin/MacAdminQuitApp.app
and I have a template script in Jamf Pro to close whatever app I enter into Parameter 4:The text was updated successfully, but these errors were encountered: