AppleScript Newbie - Display dialog box when quitting an application

Hello.
I was wondering if it's possible to write a script that displays a dialog box (in this case one saying "BACK UP!!!!") everytime i quit Final Draft.
Thanks.
F.

A regular AppleScript does not have the ability to get system notifications, so you would have to do something like have the script continually check (poll) for applications that are running.  A Cocoa-AppleScript does have the ability to do Cocoa-y stuff such as register for system notifications, so you can create a new applet (AppleScript Editor > File > New from Template > Cocoa-AppleScript Applet), paste in the following, and save it as an application (uncheck the option to show the startup screen):
property theApps : {"Final Draft"} -- a list of applications to watch for
on run -- example
  # add observers for workspace notifications
  tell current application's NSWorkspace's sharedWorkspace's notificationCenter
    addObserver_selector_name_object_(me, "appQuit:", current application's NSWorkspaceDidTerminateApplicationNotification, missing value)
  end tell
  -- tell application "Final Draft" to activate
end run
on appQuit_(aNotification) -- an application quit
  # aNotification's userInfo record contains an NSRunningApplication instance that we can get properties from
  set theApplication to (aNotification's userInfo's NSWorkspaceApplicationKey's localizedName()) as text
  if theApplication is in theApps then
  tell current application -- me
    beep 3
    activate -- make sure dialog comes to front
    display dialog "BACK UP!!!!" with title "Final Draft quit notice" buttons {"OK"} default button 1
    quit
  end tell
  end if
end appQuit_
When the application is run it will sit there and receive notifications when other applications quit, and checks to see if it was the application you want.

Similar Messages

  • How to avoid the windows "dialog box" when we use flexprintjob class

    in the print segment
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf65381-7ffc.html
    it says
       printJob.start();
    This causes the operating system to display a Print dialog box.
    this  windows "dialog box" which is used to set the page size, page index, or some other page settings.
    but in my case , i can't let user see this dialog box.
        how can i avoid this "dialog box" when i call   printJob.start();
    it is my big issue ,please help to give a suggestion

      hi   how can i set the "ie" "internet explorer"  to avoid the "dialog box."  if i have to do it .
    thank you very much !

  • English letters are displaying as boxes when telugu language is selected

    Hi All,
    I am working on an application for which we are providing the support for around 40 languages. I am having one issue when the application language is changed to telugu. When the user changes the application language to telugu, then the english letters in the application which are not localized (Left intentionally to be not localized) are displaying as boxes.
    In my application i set the file type description for the JFileChooser as "ఫ్లాష్ (*.swf)". The telugu letters are displaying correctly but english characters such as "swf" are displaying as boxes. I tested this application on Mac, Ubuntu, Windows XP, Windows 7 operating systems. In Windows 7 and Mac operating system the above issue is not reproducible but it is reproducible in Ubuntu and Windows XP operating systems.
    Please provide your valuable suggestions towards the solution for this problem.
    Thanks in advance.
    Udaya Shankara Gandhi.

    Hi All,
    Thank you for all your support in achieving the solution.
    Finally i got the solution for this problem with CODE2000.ttf font file. After i installed this font file in my fonts directory, english letters are displaying correclty. The reason for displaying english characters as boxes is the ttf files what i have used upto now (Gautami, Vemana2000, Pothana2000, Akshar) are not having support for English characters. But CODE2000.ttf file having the support to displying both english and telugu characters. After installing this font all the english letters are displaying correctly when language is changed to telugu.
    Fonts directories:
    c:/Windows/Fonts for Windows
    usr/share/fonts for ubuntu
    serach "font book" in Finder on Mac

  • In character dialog box; when I click on the "T" tool the leading shows 14.4pt.  Is there a way to m

    In character dialog box; when I click on the "T" tool the leading shows 14.4pt.  Is there a way to make the leading 100% scaled?

    "Auto leading" is governed by the "Auto leading" percentage in the Justification dialog. See http://help.adobe.com/en_US/indesign/cs/using/WSfd1234e1c4b69f30d2a5051004d659b1c-7fe7a.ht ml for a full discussion (the official Help page...).
    It *appears* you want the leading set to 100% of your font size. That is *technically* not a problem, but there are not many fonts that look nice with this. Hence the "120%" default -- neither very good, nor extremely bad. I usually go with about 2 pt above the text point size; but it depends on the font and the font size.

  • Just had help installing cc 2014. get this dialog box when i open the app. One or more files in the adobe folder necessary for running photoshop are missing. Help

    Just had help installing cc 2014. get this dialog box when i open the app. One or more files in the adobe folder necessary for running photoshop are missing. Help

    Please Run the Cleaner tool to remove Ps CC 2014 :http://www.adobe.com/support/contact/cscleanertool.html .
    Restart your system and then try installing Ps CC 2014 again.
    Regards,
    Ashutosh

  • Incomplete print dIalog box when printing PDFs

    During the past several weeks, whenever I try to print a PDF, the print dialog box (when Copies & Pages is selected in the pull-down menu) is blank ... I can't select how many copies or which pages to print. This only started happening recently, before that everything was fine. It doesn't matter how the PDF was created ... by OS X, by InDesign, by Photoshop, or arriving in email, the result is the same ... incomplete dialog box. My workaround so far when I want more copies or only certain pages, is to "place" the desired pages in InDesign and do the printing from there ... big pain and not an acceptable long-term alternative.
    Anyone know of anything that might have happened with recent software updates?

    Karen....I found this thread while looking for some help with the same problem. Did you ever find a solution? I have Acrobat 7 and 8 running on a Mini with 10.4.11 and am having the same problem in Acrobat 7 only, Acrobat 8 behaves fine. When going to the Print dialog, the area below the "Copies & Pages" button is blank. I can change the "Copies & Pages" button to other settings but the dialog box does not hold the change, it reverts back to "Copies & Pages". I have replaced Acrobat 7 without any luck.

  • How can I close windows when quitting an application - but leave desktop windows open?

    In Mavericks...
    Is there any way to close the windows of application (when quitting - ie System Preferences => General) BUT not have this affect the finder application.
    I want the windows I have opened in the finder to remain opened, but everything else to close upon quitting

    Well, for some time now (since I upgraded to Mavericks) my startup goes on and on.
    It will, on occasion, finish correctly and I can go on with my work, but usually, it hangs.
    I can restart the finder 2 or 3 times and get it to finish loading.
    If I go into System Preferences => General => and turn “Close windows when quitting an application” on, then restart, the finder usually starts up faster and does not hang
    Obviously, there is some operation that is running in the background that is trying to restore itself to some unknown state that is holding up the finder application.
    I have uninstalled and turned off all sort of applications that run in the background, but have not yet been able to locate the culprit.
    So, I’d like to be able to have “Close windows when quitting an application” on because everything else on the machine can revert to a clean start-up state -- but I want the windows I leave opened in the finder to remain opened and where I put them.

  • 11G P2 / bug when displaying pop up dialog box when using 2 displays

    Dialog box are displayed in the center the main display instead in the middle the main window. This cause the dialog to be in an another display when the main window is moved to the second display. This occured when got the error regarding "Select in Navigator" context menu announced in a previous thread.

    My config is two display 1900x12000 ... i place jdev in the second display (not the master) ... when the dialog is displayed ... it is diplayed in the center the master display (sometime in the back some existing other application window).

  • How can I disable "download error" dialog box when saving a complete web page?

    Sometimes, when I try to save a web page as type: "Web Page, complete", firefox displays download error dialog box stating a file "could not be saved, because the source file could not be read."
    I don't have a problem with firefox couldn't save that file, but I have a problem with firefox displaying that dialog box, because I have to click OK everytime.
    Is there a way to disable that annoying dialog box?

    I modified the host file mainly to block ads. But that's not the problem. It's OK for me for firefox to not saving some parts of a page (ads usually within a frame). It's my intention to NOT saving those files. I just want to save the main content of a webpage.
    But I'm having a problem with firefox displaying the dialog boxes.

  • How can i get rid of the print dialog box when using api to print an html file

    i am using the systemshell.vi provided by labview the VI is working fine but it will open a dialog box for printer selection and properties. i would like to hide that dialog box and have it print to the default printer with the default properties

    ShellExec is part of lvwutil and merely calls a function in Shell32.dll. There is nothing about the function call that controls the display of the printer dialog. I think that what shell32.dll does when it prints (just like right clicking on the file) is print the file according to what is defined about that file type in Windows Folder Options. On my Win2K system, the print application is defined as "C:\Program Files\Microsoft Office\Office\msohtmed.exe" /p %1. If I remove the /p, then Word starts up and in order to print, I get a printer dialog when choosing Print from the File menu. So it seems like the printer dialog is entirely dependant on the application that does the printing. I get no dialog when I use the VI to print a .txt file. I
    nstead of using shell32, you might want to try some ActiveX method or property of an application like Internet Explorer that can open and print an html file.

  • I no longer get the dialog box when trying to delete rejected photos.

    I have always used the Delete Rejected Photos. . . selection to get rid of the photos I have flagged as rejected. However, after the rejected photos are shown, the dialog box no longer appears with the option to Delete from Disc or to Remove from the LR Catalog. I don't know if this problem began with LR 3.4 or before, but the timing was close. It isn't that I don't know how to use the function because I have been using it for years. Any help would be appreciated.

    Since I had 358 photos out of almost 2800 flagged as 'rejected' I did not
    want to loose all my work. I selected the rejected photos and then flagged
    them all with a 'yellow' color. I then displayed all photos with a yellow
    flag and 'Un-rejected' them. I highlighted a small amount of them, about 30,
    and rejected them and then went to the Delete Rejected photos. the pop-up
    came up and I was able to delete them. Since the rest of my yellow flagged
    photos were still showing I rejected another chunk of them and so on till
    they were all deleted. When trying to delete a group that had published
    photos within I got a box warning me that if I deleted them the published
    ones could no longer be managed by LR. That is alright with me. It would be
    nice if the software would somehow flag those that had been published. All
    the dialog box said was that one or more of the group had been published. I
    did not know which.
    Thanks again for expert help!
    Jack

  • Applescript & Automator- display dialog title

    I'm trying to make an Automator service. For one of the steps I would like to use an Applescript that looks something like the one below.
    set dpaste to "Enter a title, press tab, add some text, and click Continue when you're done."
    set dialog_title to "Post To Blog"
    set dpastedialog to display dialog dpaste with title dialog_title with icon 1 buttons {"Cancel", "Continue"} default button 2
    if button returned of dpastedialog is "Continue" then
    tell application "System Events"
    activate
    keystroke "v" using command down
    end tell
    end if
    However, the line "set dpastedialog to display dialog dpaste with title dialog_title" seems to be giving Automator some trouble. Whenever I try to compile/run the script, I get the following error message from Automator: "Expected end of line, etc. but found identifier" with the variable "dialog_title" selected.
    When I run this script from Applescript Editor I get no trouble.
    Thanks!

    Test the script in the AppleScript Editor until you resolve the issue. Alternatively, post to the AppleScript forum under OS X Technologies.

  • I see two dialog boxes when I run this script, why?

    When I run this script I see two dialog boxes of "Would you like to Minimize firefox", the first has no default button selected, the second one does.
    What is going on? How do I end up with only one dialog box?
    set minfirefox to "Would you like to Minimize firefox?"
    set tempvar to display dialog minfirefox buttons {"Yes", "No"}
    set ButtonPressed to button returned of tempvar
    display dialog minfirefox buttons {"Yes", "No"} default button "Yes"
    if ButtonPressed is "yes" then
    display dialog "you pressed " & ButtonPressed
    else
    display dialog "you should have pressed yes but you pressed " & ButtonPressed
    end if

    Hi--
    Welcome to the Apple Discussions...
    StewartAlexander wrote:
    When I run this script I see two dialog boxes of "Would you like to Minimize firefox", the first has no default button selected, the second one does.
    What is going on? How do I end up with only one dialog box?
    You're telling it to display the dialog twice. Once here without the default button:
    set tempvar to display dialog minfirefox buttons {"Yes", "No"}
    and then again here:
    display dialog minfirefox buttons {"Yes", "No"} default button "Yes"
    But you're ignoring the buttons returned from the second one.
    charlie
    PS. This probably does more like what you want:
    set minfirefox to "Would you like to Minimize firefox?"
    set tempvar to display dialog minfirefox buttons {"Yes", "No"} default button "Yes"
    set ButtonPressed to button returned of tempvar
    if ButtonPressed is "yes" then
    display dialog "you pressed " & ButtonPressed
    else
    display dialog "you should have pressed yes but you pressed " & ButtonPressed
    end if

  • Is there any way to popup a dialog box when user try to create a new folder?

    Hi
    I want to add a pop up dialog ,using Flex custom UI dialog, when use click "New Folder" in Adobe Bridge ? Then user can input folder name in this dialog.
    Or I want to put this way,  is there any way to display Flex custom UI dialog and get user's input in my CreateDirectoryHandler implementation?
    The Adobe Drive SDK doesn't elaborate clearly about how to interact with custom UI dialog.
    Thanks a lot!

    Hi jmc,
                 See the links below.This will be helpful to you.
                 http://forums.ni.com/t5/LabVIEW/A-picture-as-a-dialog-box/td-p/236851
                 http://forums.ni.com/t5/LabVIEW/Dialogbox-with-user-input-and-image/td-p/1601214
    Thanks as kudos only

  • How can I keep Firefox from keeping my login name and password from being in the dialog boxes when I sign on on gmail? It allows anyone to log into my email account

    When signing on to my gmail account the two dialog boxes, one for account name and the other for the password are already filled in. The password box has dots for the password but anyone who clicks on the sign in box can read my mail. How do I change this? It appears to be a Firefox related issue because it doesn't happen if I sign in on Safari or Internet Explorer. I would appreciate your help.

    See [[Remembering passwords]], you can turn this feature off.
    You also can [[Remembering passwords#Viewing and deleting passwords|view or delete the saved passwords]].
    Please let us know whether that works for you.

Maybe you are looking for

  • How to connect 2 24" Cinema Displays to a non Thunderbolt MBP

    Hi I have a 2010 15" MBP and two 24" Apple Cinema Displays.  I recently purchased a Matrox DualHead2Go Digital ME graphics expander thinking I could connect the two displays to it.  However, the displays have mini displayport connectors and the Matro

  • NWDI track error while check in activities

    Hi All, I have activated a DC which holds a process and the activity error out during check in and activate. So, I've forcefully build and checked in to the track. Looks like the track is now corrupted because no matter what ever changes I am doing f

  • Active user List

    Hi I am using 10.1.3.4 OBIEE. How to find what are the user loged in Presentation services. e.g User1 loged in Answer page,he is looking into Dashbord 1 User2 loged in looking into Dashboard2 User3 is administrator.He want to know,what are the users

  • Function modules to create the relationship for Reference Personnel IT0031

    I tried using BDC recording PA30 to create the relationship for reference personnel but it dun seems to work. Anyone knows of any standard function module to create that relationship instead.

  • SOAP using JMS

    Hello, We are in the process of experimenting SOAP using JMS using Weblogic Server 10.3. 1) Is there a way in Weblogic 10.3 during deployment(NOT during development) we can switch the transport to JMS instead of http. We want to do this during the de