Force Logout without "Do you want to save?" Prompt

Hi,
I am new to Applescript, and have been trying to learn as much as I can.  Most of it makes sense, but I'm having a few issues with a particular task.  I've been asked to come up with a way to essentially log out a user after 30 minutes of inactivity.  That part's not really an issue, but when it comes to actually logging the user out, I run into a problem if the user has any open, unsaved documents opened.
This forces the "Do you want to save changes?" dialog box to appear, which - if left unanswered - ends up causing the log out process to timeout.  I suppose what I'm wondering is if there's any way to force close all programs/open documents/etc. with no prompt to save and log off.  Other sites and forums mentioned using Unix commands, but I'm not that familiar with them (and most "do shell script ..." and some variation of "killall" still brought up the same user prompt about saving).
I totally understand the reason behind prompting users about that, but I'm just trying to figure out if this is possible.  Any hints, tips, or advice really would be appreciated.
Thanks!

Your problem here is that it may depend on the applications in use.
All applications should understand the 'quit' event, so you can tell them to quit. Most of them should also accept the optional 'saving' parameter to tell them whether or not to save open documents, but there's no guarantee of that.
In addition, recent applications that support versions and resume shouldn't prompt at all - they should save their current state and just restore that state next time they're launched.
So, since there are multiple cases that require different actions, your first problem is going to be categorizing applications so that you know what actions to take. Given that you likely can't predict all the applications that will be running, that's going to be hard to do.
I might be over-thinking it though, so let's simplify:
First, it's easy to get a list of running apps:
tell application "System Events"
          set runningApps to every application process whose background only is false
end tell
From here it's easy to iterate through them, first trying the 'safe' option of not saving changes. Here I'm using a 'try' block to catch errors (e.g. the application doesn't understand the 'saving' parameter), at which point I can re-try the quit without the parameter:
repeat with eachApp in runningApps
          try
                    tell application eachApp to quit saving no
          on error
                    try
                              tell application eachApp to quit
                    end try
          end try
end repeat
So, in essence, this will iterate through the runningApps. It first tries to tell the application to quit with the 'saving no' option. If that fails it then re-tries without the 'saving' option.
This should be enough to quit most apps, after which you can issue the log out command.
If you have applications that support versions and restore you could put them in an exceptions list, knowing that when they're told to quit they'll save state, so you don't need to interact with them

Similar Messages

  • Gettins "Do you want to save the changes you have made" promt without any

    Hi all,
    Problem : I have a master detail relation between two blocks which are on different window ( say block 1 on window 1 is master and block 2 on window 2 is detail) ,
    when i open my window 2 and close it without any changes, then when i try to do any change in window 1 i get this popup message "Do you want to save the changes you have made".
    I have various non database items as well which are used to hold intemediate values like sum of a column and all.
    for the close button on window 2 logic :
         go_block('BLOCK1');
         hide_window('WINNDOW1');
    I dont want to change the message level. as if there are really changes made then we need this message.
    In another thread i saw this might be due to copy "value from property" created by master detail relation on the joined columns.
    Please suggest any solutions.
    Thanks in advance.

    HI I found the solution to this Problem:
    when we queried the data block then few items values were assigned . this changes the block_status to CHANGED as well as the form_status variable to CHANGED.
    so in EXIT logic of that window i cleared each block explicitly . this discards all the changes made to those blocks ( This logic was implemented for CANCEL button on my screen as so we need not save the data) while the SAVE logic already has the COMMIT so will not set the popup for that.
    Not a beautiful logic...... but works ...... :)

  • How do I stop pop up that asks me, Do you want to save changes to doc... before closing? I have made no changes only printed the file. Using Adobe Reader DC, Windows 7 64 bit.

    How do I stop pop up that asks me, Do you want to save changes to doc... before closing? I have made no changes only printed the file. Using Adobe Reader DC, Windows 7 64 bit.
    This is very annoying and we need this stopped as we have made no changes to any of the adobe files. Please advise how to do this.
    Customer Service DCC

    I first tried the version without the deflated stream (so everything uncompressed) against the online repair tool to check/analyse it @ https://www.pdf-tools.com/osa/repair.aspx
    And it says no error found, but the reader still want to save it when closing so i still had no clue at this point.
    Fortunately, i finally found what was wrong with my generated PDF.
    In my xref table, each object reference was not end by a full EOL, i only did put a newline char.
    Now i have "carriage return" "newline" which is the full EOL and the reader is happy and close the file silently.
    As suspected i did not follow correctly the specs on xref table
    Now i'll go and figure what i did wrong with the deflate filter
    Thanks for your help.

  • Adobe Reader X (free) -- "Do you want to save changes" prompt

    Why is this prompt always coming up when I close a PDF document?
    "Do you want to Save Changes to  X   Before closing?"
    I am using the free Adobe Reader X 10.1.1.  I can't make any changes to the file since it's the free version, so why is it asking me to save changes?  Even if I just open the file and just close it right away without doing anything else the prompt comes up.

    I think pretty much any PDF created by CutePDFWriter did that (as well as others not created that way, but CutePDF seemed to do it reliably).
    To verify that I'd have to un-install 9.5.0 and re-install Reader X, which I'd rather not do (9.5.0 is better in other ways too - the integration with Chrome is nicer because the "print" and "save as" buttons always appear; they hardly ever appeared in Reader X when opening a PDF from Chrome).
    You can get CutePDFWriter here: http://www.cutepdf.com/products/cutepdf/writer.asp
    Let me know if you can't reproduce the problem (just post here) and I'll un-install/re-install, verify a file with the problem, and post it.
    For now I'm very happy with Reader 9.5.0; it's perfect.

  • Unexpected & Unnecessary Popup "do you want to save changes to 'x' before closing ?"

    Hi Im running a code that is opening a pdf doc and reading some stuff from it (not editing it).
    avDoc = CreateObject("AcroExch.AVDoc")
    avDoc.Open(FileBox.FileName, "x")
    accroApp = CreateObject("AcroExch.App")
    accroApp.Show()
    accroApp.Hide()
    accroApp.Exit()
    avDoc.Close(0) 'accroApp = Nothing
    But when I close it gives this question "ONLY SOMETIMES"
    "do you want to save changes to 'x' before closing ?
    Previously, i just forced it to save at all times before closing.
    I guess there is a way to avoid this, by setting some dirtyflag=false/true?
    Pls help
    JS

    Check out this post - http://forums.adobe.com/message/3871646#3871646
    My issue was similar and I finally got it to work.

  • Disable "Do you want to save changes to *.pdf before closing?" when closing a tif

    We upgraded to Office 2007 and decided to stop using the Office 2003 document imaging tool to view TIF TIFF files.  This tool wasn't included with Office 2007 so we started using Acrobat 9.1.3 Standard as our default TIF viewer. 
    Here is the problem. When you close the TIF document you are prompted "Do you want to save changes to 'xxx.pdf' before closing?" Is there a way to disable this prompt?  We don't want to convert the files since they are in a read only database.

    Nope. Using WORD or Acrobat is forcing a conversion and it not an ideal way to view such files. In addition, you may want to change resolution or such of the graphic before you import it to something such as WORD. Many folks embed graphics that are 3500 dpi and millions of colors and totally bloat the file. They even crop the graphic and reduce the size, wondering why their DOC file is sooooo big. In that sense, there is an advantage to having some of the other tools available. You may have special needs and I do not want to second guess your company needs, so that is my two-cents worth. Sorry that I do not have other ideas, but using an existing graphics package would be the best for your need.

  • Do you want to save changes made.

    i have m/s detail form.
    detail section is not compulsory need to be entered.
    i have put the following code in the When-New-Record-Instance at form level;
    IF :SYSTEM.FORM_STATUS ='CHANGED' THEN
           IF      SHOW_ALERT('ALERT68')=ALERT_BUTTON1 THEN
                  COMMIT_FORM;
           ELSE
                NULL;
            END IF;
    END IF;whats happening, or how i want my form to do behave is, in query mode, lets say i change a value
    and based on some validation i get raise form_trigger_failure is fired,
    i decide not to correct and leave the record as is with the old value and press down arrow or create-record button,
    at this point whether the form is in between some records or at last record,
    before it goes to the next record or new record, i should be prompted me "Do you want to save.."
    selecting YES should remain with the trigger_failure,
    selecting NO should discard/ignore the trigger_failure error and move to the next rec or blank rec.
    with the above code in When-New-Record-Instance at form level,
    i am prompted with the message "Do you want save..." at the start of the form.
    please suggest. tyvm
    Edited by: user613563 on Jul 6, 2009 12:46 PM

    first of all, you should put your assignments to the correct place. This could be either the Initial value of the item itself, if its a fixed value, or the formerly mentioned WHEN-CREATE-RECORD-trigger.
    As for your requirement to not allow the user to leave the record without saving, thats a quite complex task. If you just show one record in the block, you could do your checks in the KEY-triggers which navigate to the next record or create a new record (KEY-NXTREC and KEY-CREREC). But it will not work if you have a multi-record-block (for the mentioned triggers will not fire when using the mouse).
    Any special reason for this requirement?

  • Closing Error - Do you want to save changes to '..... . pdf' file?

    Hi,
    I am kinda stuck with this error for a long time now and I always thought that changing to a new PC would resolve the issue. Unfortunately that did not help and hence I am seeking a solution using this community forum.
    In brief, whenever I try to close a pdf file, it prompts me with an error asking "Do you want to save changes to '..... . pdf' file" when I have not made any changes to the actual file. Could someone please get back to me on how to resolve this issue? It is quite annoying for the fact that sometimes I get more than 10 pdf files opened and closing them one by one with this error is just too much of an ask.
    I look forward to hearing from technical gurus out there and would really appreciate any prompt replies.
    Many Thanks,
    YSF

    - Just tried the file you sent and there weren't any issues there. I saved the file and then closed it successfully without any prompts popping up.
    - In regards to the opening of the files, I am opening them from within Adobe Reader itself.
    - The pdf files basically are forms and don't include any interactive elements. So this is how it works, I use the print command from the database to save the file in pdf. Once the file is saved and opened, that is when I get the error message when closing the file.
    Hope this help. Really appreciate your prompt response there!!

  • "Do you want to save changes" always poping when closing home made PDF

    Hi,
    I create a pdf by myself in one of my application (only external lib used is zlib for deflate streams)
    I tried to follow the PDF references.
    It's a simple PDF file with a few pages, some text & lines to underline (deflated or not same problem), and 3 fonts, a xref.
    The PDF is showing perfectly in the Reader X 10.1.1 but when i try to close the window it always asks me :
    "Do you want to save changes before closing".
    All save options are disabled in the preferences of the reader.
    Is there anything to do in the reader to avoid this ?
    Is there anything to do in the PDF itself to avoid this ?
    Or maybe the PDF is not completly correct ? Which is possible even if i tried to follow the specs in the official reference document, there are alot of chances that i may have done something wrong.

    I first tried the version without the deflated stream (so everything uncompressed) against the online repair tool to check/analyse it @ https://www.pdf-tools.com/osa/repair.aspx
    And it says no error found, but the reader still want to save it when closing so i still had no clue at this point.
    Fortunately, i finally found what was wrong with my generated PDF.
    In my xref table, each object reference was not end by a full EOL, i only did put a newline char.
    Now i have "carriage return" "newline" which is the full EOL and the reader is happy and close the file silently.
    As suspected i did not follow correctly the specs on xref table
    Now i'll go and figure what i did wrong with the deflate filter
    Thanks for your help.

  • How to enforce the message "Do you want to save changes?"

    Hello,
    How to enforce the message "Do you want to save changes?" when the user attempts to close a form after checking a non-database item (check-box).
    All the other database items in the block are not updateable and only viewable.
    After checking the non database item check-box, if the user tries to commit, then the system is saving the changes and call the appropriate procedure on save.
    But if the user tries to close the window without committing, the form is not showing the message "Do you want to save changes?" since the check-box is a non database item.
    How to enforce the message "Do you want to save changes?" in this scenario when the user tries to close the window?
    Thanks in advance.
    Cheers
    Sri

    This is a fairly common question in the forum. You will need to override the default exit form process and check to see if the checkbox is checked. You can do this in the Key-Exit trigger. For Example:
    DECLARE
      al_id     ALERT;
      al_button  NUMBER;
    BEGIN
      IF ( CHECKBOX_CHECKED('YOUR_BLOCK.CHECKBOX_ITEM') ) THEN
         /* Display an Alert here that asks, "Do you want to save changes?" */
         ...code here to set the properties of your alert...
         al_button := Show_Alert(al_id);
         IF ( al_button = ALERT_BUTTON1 ) THEN
            --YES
            /* Perform COMMIT Processing here...*/
         ELSIF ( al_button = ALERT_BUTTON2 ) THEN
            --No
            Exit_Form(NO_VALIDATE);
         ELSE
            --Cancel
            RAISE Form_Trigger_Failure;
         END IF;
      ELSE
         Exit_Form;
      END IF;
    END;If you need more help with the Alert, please check out the SHOW_ALERT topic in the Forms Help.
    BTW, what happens if all the user does is check the checkbox? No other changes have occured. What changes are you trying to process?
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • 'Do you want to save changes you have made' while closing the form

    Hi Everyone,
    I am working on Oracle Applications 11.5.10.2 version. I have created a new form as per the client requirement and registered with APPS. I met all the requirements, but when ever closing the form getting the error 'Do you want to save changes you have made' without entering or modifying records in he form.
    Please help in this regard, bit urgent.
    Thanks in Advance..
    Venky.

    Hi,
    You can suppress messages depending on their message level. For a full description and examples on this topic, please see the help in Forms Builder (press F1 in your Builder) and search for :system.message_level.
    or the other way would be.
    As you are using the copy command for moving the data from one block to the other block , the status of the block will be changed to "Modified".As per oracle standards when every the block status is modified it fire the meassage 'Do you want to save changes you have made' .
    To avoid the message you need to change status of each line to "Query" .Once you do this the block status automatically changes to "query" .Once it is in query mode when you try to close the form it will not pop-up the above message.
    To change the line status use POST command . To get help on this command you can use form builder help.
    Hope this serves your purpose.
    Let me know if you need any further clarification.
    Rgds,
    Naveen.

  • How to remove the warning "do you want to save changes to investigation.pdf before closing"

    Issue: To remove the warning "do you want to save changes to investigation.pdf before closing"
    I have created a XFA pdf file(using LC Designer 8.2) to display this issue
    I am not able to attached the PDF. Without attaching the pdf it would be difficult to explain.
    click event js:
    function activateUser() {
      var PDFVersion=xfa.host.variation+xfa.host.version;
      xfa.host.messageBox("button click event registered");
      xfa.form.form1.sendForm.welcomeMsg.presence = "invisible";
      xfa.form.form1.sendForm.successMsg.presence = "visible";
      event.target.dirty=false;
    docReady event js:
    function displayInfo(){
    var res =xfa.host.variation;//Added this line to display the successMsg
    //xfa.host.messageBox("docReady event registered");
    xfa.form.form1.sendForm.welcomeMsg.presence = "visible";
    xfa.form.form1.sendForm.successMsg.presence = "invisible";
    docClose event js:
    xfa.host.messageBox("docClose event registered");
    event.target.dirty=false; 
    Steps to get the warning:
    1) Open the attached pdf using Acrobat Professional.
    2) Click the Confirm Enrollment" button
    3) Now close the document & the acrobat gives a warning "do you want to save changes to investigation.pdf before closing"
    Summary of the XFA pdf:
    It has two text fileds. On docReady event field A is made visisble & field B is made invisible.
    On button click event the field A is made invisisble & field B is made visible.
    On closing the pdf it should not throw this warning message.
    My Efforts:
    1) Found a property in adobe js docs.
           event.target.dirty=false;
    It doesn't solve the problem.
    2) I tried to put this logic in almost all the events listed in designer but I am not able to resolve the issue.
    Please help me resolve this issue.

    I tried putting the below 2 lines of code at the end of button click event & docClose event.
          event.target.dirty=false;
          event.target.requiresFullSave=false;
    It still gives the warning.
    Also I tried to found out the line of code which is making the pdf dirty.
      xfa.host.messageBox("is doc dirty (before displayInfo's visible-invisible work): " + event.target.dirty);
      xfa.form.form1.sendForm.welcomeMsg.presence = "visible";
      xfa.form.form1.sendForm.successMsg.presence = "invisible";
      xfa.host.messageBox("is doc dirty (after displayInfo's visible-invisible work): " + event.target.dirty);
    The doc got dirty when the successMsg field is made invisible.
    Problem I am trying to solve is:
         To display a welcome message before user action and after user action wants to display a success message.
         I follwed the visible & invisible approach & it wokred but gives me a warning on doc close.(Highly imp to avoid it)
    Is there any other approach I could follow here.

  • Do you want to save the record on detail block

    I have a master detail form. When i update the detail section and navigate to a different master item. I am getting do you want to save the record on my detail block.
    I want to post the changes everytime on the detail block. As i will rollback or commit depending if user saves the form or not on a button press.
    But I can not find any trigger that fires when i change the master record (after changing the detail block) any ideas?

    Hello all,
    I have problem to save list of records in stacked canvas block, that is it always save the record where current reocord indicator is indicating,
    can somebody help me out, how to save data on stacked canvas without having master-detail relationship.
    Regards,
    Ather Ali
    Edited by: user11972516 on Apr 17, 2011 1:27 AM

  • You must specify the a of filter if you want to save you filter- dependent

    I get this message when I try to save an implementation for BADI :  NOTIF_EVENT_SAVE
    Specify filter types
    Message no. ENHANCEMENT213
    Diagnosis
    You must specify the a of filter if you want to save you filter- dependent BAdI implementation.
    System Response
    Without a filter type, the implementation cannot be saved.
    Procedure
    Enter a filter type.
    The filter type already exists.  This is a standard SAP BADI.
    There are related notes but not for my ECC 6.0 release. 
    I am using:    SAP_BASIS  700  SAPKB70013
    Has anyone had this problem?

    I think u have already had ur Document Types.
    Now using Tcode Se18 u will goto BADI. There U will Select Implementation --> Change / Display.
    Now at below u will see Filter Dependent Check Box Checked which means that the BADI requires a filter.
    Below that u can enter Ur document Types as filters for which types only u want the BADI to be processed. If u want all the Types to be entered and as the BADI is Filter Dependent , u have to enter all the Document types. Now the BADI is triggered only for the Documents containgin that Document type u entered in the filter only.
    awrd points if useful
    Bhupal

  • The latest version of Firefox no longer asks if you want to save open tabes for your next session..I HATE not having that option. What were they thinking?

    Question
    The latest version of Firefox no longer asks if you want to save open tabs for your next session..I HATE not having that option. What were they thinking? (I think this is self explanatory)

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session at any time.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />
    <br />
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox (Tools) > Options] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

Maybe you are looking for

  • Difference in Local currency and Group currency Balance

    Hi, I have a query where ... Company code has 2 currencies ;Group currency is USD and Document Currency is GBP This GL account is zero balance account . It has alredy set up in Document spitting customization setting Through FB03 normal view we can s

  • Class Interface error

    I'm getting an arror on the very last line beside the final curly brace and I don't know what to do. //Bill2.java --- Ned Leonard /*This is a simple program to calculate a company's electricity bill. There are three rates: *First 240 kwh:          11

  • Doesn't play all the music I downloaded!

    I downloaded 243 songs to my iPod Shuffle and when I play it in my car only 106 shows up!  Very aggrevated!!  I have an iPod Touch and I've never had any trouble.  The only reason I got the Shuffle is to be able to leave it in my car so I can play th

  • Listeners also subscribed to

    I see this with links to other sites on my podcast and others, how does this work, do subscribers add other links or are the links generated by I Tunes?

  • Problems with updating applications manually

    Hi! I'm working with Mac OS X 10.7.3 with a user-account that has no admin rights. I have several applications (e.g. Dropbox) that I update manually (= mounting the disk image and then replacing the old version in the applications-folder with the new