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 8056309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:39:54+00:00 2026-06-05T08:39:54+00:00

I want to open another separate application, open the projects/documents of that application in

  • 0

I want to open another separate application, open the projects/documents of that application in a iterative way and then close the application. I also want to close all the modal and non modals dialogs which popped up during the opening of the document. I want to close all the dialogs including the crash dialog in case the application fails/ crashes.

What will be the best way using cocoa or applescript to achieve this and from where i can get more detailed information?

  • 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-05T08:39:56+00:00Added an answer on June 5, 2026 at 8:39 am

    If the app has a scripting interface, of course the best way is to do that.

    You generally don’t want to iterate in AppleScript, but rather to operate on all of the results of a query.

    For example, for almost any application that implements the “standard suite”, you can just:

    tell app "TextEdit" to close windows
    

    This is much simpler (and faster, and more likely to be implemented correctly in the target app) than:

    tell app "TextEdit"
      repeat with theWindow in windows
        close theWindow
      end repeat
    end tell
    

    Of course this may pop up save/abandon changes dialogs, and it may skip over or include dialogs and inspectors, and so on, depending on the application’s user model.

    More importantly, it won’t work if the app doesn’t support scripting (and the standard suite).

    Also, it won’t help at all with closing a crash report—that window is owned by CrashReporter, not the original application (which is a good thing, because you can’t talk to the original application anymore, now that it’s crashed…).

    The alternative is the UI Scripting features in System Events. This will only work if assistive access is enabled. It can also be a bit fiddly to figure out which windows are the ones you want to deal with, and which controls are the ones you want.

    For example:

    tell app "System Events"
      click button 1 of windows of application process "TextEdit"
    end tell
    

    This works by finding every window (no matter what kind) owned by the TextEdit process, and simulating a click on the first button in that window (the red close button).

    If you google “AppleScript UI Scripting” you should find lots of different guides. The first hit I found was http://www.makeuseof.com/tag/applescripts-ui-scripting-mac/ and it looks like a decent place to start.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET button in my application, which I want to open another
I have multiple, separate leiningen projects that ostensibly could depend on one-another. Example: ~/projects/mywebapp
I don't want to open another Yet Another Js VS Js thread. I guess,
I want a link to open up another view in my webapp to display
In one ASP.NET application, we provide a link to open another application. If user
I have two nib files, one that will open at startup and another that
I am using Crystal Reports with C# programming language. I want to open another
I'm making a web application for a customer that has clients who want to
In MainWindow.xaml.cs I want to open another window. My code is this: WordToHtml.Window1 newForm
I am designing a C# application that will open a PowerPoint presentation, split the

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.