How to terminate an app when last window closed?

it is driving me nuts, i am doing an xcode projetct: an
applescript cocoa application.
so far so good, but:
how can i terminate the application, when the last window
is closed??
i have read anything about ApplicationShouldTerminate...... methods
and any obj C method that could have something to do with this topic,
but how can i do this operation in an applescript application?
thanks
Derand

There are several application delegate methods that can be added your AppDelegate.applescript (see NSApplicationDelegate Protocol Reference) - the one you are looking for is applicationShouldTerminateAfterLastWindowClosed:, for example
on applicationShouldTerminateAfterLastWindowClosed_(sender)
       return true
end applicationShouldTerminateAfterLastWindowClosed_

Similar Messages

  • I have just installed os7. How do I close apps when I double click on home button

    I have just installed os7. How do I close apps when I double click on home button

    Swipe to the app you want to close, press and hold the large image and swipe up and off the screen

  • TS1702 how do you load apps when you turn it on you have a blank screen.

    how do you load apps when you turn your ipod on it has a white screen

    Try here:
    iOS: Not responding or does not turn on
    If you can't turn t off then lett eh battery fully drain. After charging for at least an hour try again.
    If not successful then time for an appointment at the Genius Bar of an Apple store.

  • How to close child windows when parent window closed in jsp

    how to close child windows when parent window closed in jsp
    becoz it can't be able to recognise it's parent
    with the whole application
    plz send me some sample code of it

    Hi, I have no idea how to do this is JSP.
    However createing a modal window (with javascript) would mean that the user can not use the parent window untill he closes the child window. However not sure if this is what you are searching.
    Otherwise you can detect the onClose (I think) and close the window from there.
    However both the above are JavaScript and not JSP.
    rwgards,
    sim085

  • ***How to call BSP App when custom button event fired from toolbar group***

    Dear PCUI Experts,
       I have created one custom button for the transaction CRMD_BUS2000116.
    And my urgnet requirement is , I need to call BSP application which is used to   take data from custom fields and stores into BP table.
    How to call the BSP App. when i clicks on the button.
    Please help me..
    I will reward with great points.
    Regards,
    Stella.

    Hi Purushothaman,
                                 I have created a button in CRRM_ACCOUNT application.
    Now i want to call  a custom bsp application by clicking on that button.I have followed step given in this blog
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1646. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    But the event is not triggered.Do I have to create an iview for my bsp application?
    How to do that?Plz help.
    Regards,
    Ruby.

  • How can I shut down when printer window is locked?

    How can I proceed to shut down when printer window is locked?

    Thank you, i will try this option. Only thing is i did read another person having this problem and he did shut down his computer and now his photo library in unaccessible!!! Ugh. I do have an external back up hard drive. I sure hope that my photos are on there to reload into iPhoto!!!!
    I did try to place my mouse over the iPhoto icon @ the dock and held down the control key with no results in shutting down the application.

  • HT2731 How can I update apps when the screen just goes blank?

    How can I update apps on my iPad my screen is just blank. My phone updates fine.

    There are a number of other threads from people reporting a problem with a blank Updates tab in the App Store app on their iPads - it looks like there is a problem at Apple's end which they need to fix.
    Some posts are suggesting that you if you go into the Purchased tab in the App Store app you might be able to update the apps from there, though you will need to scroll through the list (potentially going through the A to Z list on the left-hand side of the screen, and similarly tapping the 'iPad Apps' button at the top left of the screen and selecting 'iPhone Apps') to find those with updates and individually update them.

  • Did you change how Cmd-T opens tab when no windows displayed?

    One of my favorite Firefox commands was Cmd-T which, when no windows were displayed, brought up a new window with focus in the address bar so I could immediately type a new address or search. This eliminated CMd-N waiting for my home page to load, repositioning focus to address bar & erasing contents of address bar before typing a new address. Although not specifically documented, it was probably the Firefox cmd I most used. As of most recent update this has changed. It now opens a new tab in some hidden window but doesn't display it. This seems worthless. Please consider restoring this feature to the way it was. Thanks!

    I do Graphics/Production work for an archaeological firm. Before I started working here, they decided that of the different export options from our GIS department, EPS was the format that gave us the least problems and the highest quality. This was decided when we were using Illustrator 10. Now we're making the shift from CS2 and 3 to CS5 (getting our department on the same version), we are running into this problem with the EPS files and I am trying to find a solution to make all of our lives easier. One of the other options that we are kicking around is ditching the EPS file format all together and shifting to using a high quality PDF instead. Could this cause any loss of quality?

  • Last Window closed - quits the application

    I remember seeing somewhere a little shareware program that quits an application when the last open window in the applicaton is closed. Can anyone direct to a program that will do this for me. Folks moving to Mac from Windows have this difficulty of closing a window and thinking the application has been quit. Thank you.

    Have you searched MacUpdate or VersionTracker. Both of those sites have just about every piece of software on them.
    Leaving an app open doesn't hurt anything. It doesn't use cpu or waste memory unless you have so many apps open that VM and RAM can't handle it. What you want would have to patch itself into each app to determine that the last window was closed and most likely cause more issues than leaving the app open.
    Cmd+Q works a lot better for quitting than clicking the window close button.

  • How do I delete apps when I cannot get the red x, I cannot update the iPad because of lack of memory space. I heard it was a bug in the last version of the op.system, any ideas?

    I cannot update the iOS because of lack of memory (3.5 GB required). The apps cannot be deleted because I cannot get them red x in memory management or when they shake for reorganization. I heard this was a bug in the last update of the op. system. So what is the process?

    From where did you hear this..?
    Lockie555 wrote:
    I heard this was a bug in the last update of the op. system.
    DELETING APPS
    Touch the app and hold your finger down until all the apps start to jiggle. You will see a circled "x" in the upper left corner. Tap it to delete an app. When done press the Home button.
    You cannot delete any pre-installed iOS app.
    If there is No 'X' on any apps you have Downloaded... then check in Restrictions...
    Settings > General > Restrictions
    Understanding Restrictions  >  http://support.apple.com/kb/HT4213
    Lockie555 wrote:
    I cannot update the iOS because of lack of memory (3.5 GB required).
    Alterrnatively you can update using iTunes on the computer you usually sync with.
    See the Using iTunes Section Here...
    How to update your iPhone, iPad, or iPod touch
    NOTE:
    Make sure you have the Latest Version of iTunes (v11) Installed on your computer
    iTunes free download from www.itunes.com/download

  • How to enable web-app "parent-last" classloading in WLS 10.3?

    Hello,
    We are having some issues when using Groovy to execute ant tasks in a webapp. They are due to the classloading order in WLS.
    The problem is this :
    - Our webapp is using Groovy 1.5.6.
    - Groovy 1.5.6 uses ant 1.7. When groovy calls ant tasks such as <untar>, <unjar>, etc, it is passing the <mapper> element, which is supported in ant 1.7.
    - When this webapp is deployed in WLS 10.3, Groovy tries to call these ant tasks, but WLS has ant 1.6 which does not support the nested <mapper> element groovy is trying to pass.
    - The groovy script blows up with an ant error because of the unsupported element.
    - We are packaging ant 1.7 jars in the WEB-INF/lib dir of our WAR file, but WLS is loading the classes from it's own classpath first, so we do not get the 1.7 impl loaded.
    The solution is to enable "parent-last" classloading for this webapp, but I can not find any documentation on how to do this.
    In Websphere you can set a checkbox for it in the console.
    In Orion, you add to the orion-web.xml file this tag <web-app-class-loader search-local-classes-first="true"/>
    ** In WebLogic, how do you do this?
    I have been searching the documentation and asking around, and I can not find an answer yet. Thanks in advance for your help!

    Try either a filtering classloader as described here:
    http://edocs.bea.com/wls/docs103/programming/classloading.html#wp1097187
    Or prefer-web-inf-classes in weblogic.xml:
    http://edocs.bea.com/wls/docs103/programming/classloading.html#wp1082452

  • How can I make apps in a Windows PC

    Hello, i what to make apps for Apple Store but i don't have a Mac or a iOS but I have heard that I can make apps in my computer that has installed Windows 7, is that true ?

    Conduit also has a free app builder for iOS that you can use right winthin your own browser window! NO MAC REQUIRED!
    That is not correct. OP, be sure to read through all details of how these services work before jumping in, since your goal is to publish an app to the Apple App Store. For example, Conduit's Guidelines for Submitting Apps to the Apple App Store state you need an Apple iOS Developer account and include this:
    Note: You will need to complete the last step of the submission process using a Mac computer
    The appsbar site does not have any details about the iOS app submission process. The web site does state iOS apps are HTML5, so I suspect appsbar apps for iOS are web apps accessible through the browser, not the Apple App store. Otherwise the submission process would take way longer than the stated 3 to 5 days.

  • How to transfer data & apps,When upgrading from a iPhone 3G to an iPhone 4 or soon 5

    When upgrading from a iPhone 3G to an iPhone 4 or soon 5
    How to transfer all phone number and apps and notes, pretty much copy my old iPhone to my new iPhone , all content and apps.
    Will it transfer my text messages also?
    Is this a nightmare or an easy task?

    Connect to iTunes and backup. Then when you receive the new phone restore from that backup.
    http://support.apple.com/kb/ht1766
    http://support.apple.com/kb/ht1414

  • How to re-download Apps when you have canceled and then restarted a membership

    Hi There,
    I recently (in the last two weeks) canceled a membrship, and then started a new membership. In that time my apps expired so I deleted them from my harddrive. Today, I wanted to reinstall apps, but when I did via the CC Downloader it had all my old apps from the previous membership logged. I do not have a backup of my hard drive so i can't reinstall my sytem with the former apps. So, what are my options.
    I am on the latest MAC OS.
    Thanks in advance for any assistance!

    http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html

  • HT4623 I did the update, and now I don't know how to close an app when I'm done with it

    I did the update and don't know how to close apps that are open

    Force close apps
    1. Double tap the home button to bring up the multi-tasking view
    2. Swipe the app's windows upwards to close
    3. The app will fly off the screen
    http://support.apple.com/kb/ht5137

Maybe you are looking for