Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:55:32+00:00 2026-06-09T12:55:32+00:00

os.system(open /Applications/Mail.app) I’m able to open mac applications using the above statement(though not able

  • 0
os.system("open /Applications/Mail.app")

I’m able to open mac applications using the above statement(though not able to open applications which include spaces in their name. eg.Photo Booth).

But I cannot find a method to close apps.How do i do that? Googled a lot but all the solutions mentioned were for windows.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:55:33+00:00Added an answer on June 9, 2026 at 12:55 pm

    With respect to opening applications with spaces, you’ll probably find you can do something like:

    os.system("open \"/Applications/Photo Booth.app\"")
    

    or:

    os.system('open "/Applications/Photo Booth.app"')
    

    The reason why there’s probably not an equivalent close command is because it unbalanced.

    Opening two applications with the same parameters is easily done, you just create two separate processes. However, when you then want to close one, which gets hit? They both have the same name.

    You can look into using kill once you establish the process ID of the process you’re trying to get rid of, or you can use osascript to tell applications to exit:

    osascript -e 'tell application "PaxsDodgyApp" to quit'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have about 5-6 applications that I have open on my Mac which I
My unit test keeps getting the following error: System.InvalidOperationException: The Connection is not open.
We have a system which consists of numerous applications. All applications have their version
When I tried the console programming, I received unexpected result. open System let printSomeMessage
I'm working on replacing a window.open() notification system and think to implement this with
Are there any good open source frameworks for developing computer system emulators? I am
I'm creating Content management system in asp.net. But I need open source cascading stylesheet
I wish there was a central, fully customizable, open source, universal login system that
Are there any free or open source build systems to which you can volunteer
I found there are at least three ways to launch an app with Mac

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.