简体   繁体   中英

How to make the Firefox application quit when the user hits its close button in Mac

I open the Firefox application using a

     open -n -a Firefox.app

When I close the window of this Firefox application, only the window closes but the application still keeps running. I know that I could use Command+Q, but I want the application to quit when I click the Close button.

I have looked up for various command line options but haven't been able to figure out a way to start the Firefox application so that when I close the last window, the application itself quits.

I know this has more to do with Mac treating Applications and Windows differently. So how do I approach this problem?

Are there any other command line arguments that I can pass to make this work?

您可以使用osascript使用AppleScript将退出的AppleEvent发送到应用程序

$ osascript -e 'tell application "Firefox" to quit'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM