Display a dialog box after the ejection of a USB drive, saying the car was ejected

Hi, would someone please tell me how to change the applescript below to eject my USB in 2 ways, either by waiting 30 seconds by pressing the button "YES". Then, once the disc has been ejected another dialog box would appear to say 'eject disk '. If 'NO' button has been activated the reader wouldn't be ejected. My USB is indicated as (the present book).  Thanks in advance for any help.

                                                            tell application 'Finder '.

display the dialog box "Eject USB drive?" default button 1 with the title "Eject?" buttons {'yes', 'No'} give up after 30

If the button returned of the result is 'yes' then ejection of the this book

tell the end

Here:

Tell application "Finder".

Display dialog "Eject USB Drive?" buttons {"Yes", "No"} default button 1 with the title "Eject?" give up after 3

If the result back button is 'yes' or abandoned then of the result

This book of ejection

display the dialog box 'Disc ejected.'

end if

tell the end

(143586)

Tags: Mac OS & System Software

Similar Questions

  • Is it possible to display a dialog box with the fields/custom controls for the Windows Vista login screen to the top.

    Hello

    In Windows XP (prior to Windows Vista), a Service could be interactive and display a window/dialog on the login screen.

    Of course services are no longer allowed to be interactive, and certainly, I agree that it is an improvement in security.

    However, say if I wanted to do one of the following values, which is possible (and how to implement). I don't mind what language I have to set in.

    (1) add a button in the login screen that says "Reset Password" which will then invite a form with questions of security.

    (2) run an application within the login window

    Really appreciate any help on this matter,

    Mark

    Hi Mark,

    The question you posted would be better suited in the MSDN Forums; We recommend that you post your question in the MSDN Forums to get help:

    http://social.msdn.Microsoft.com/forums/en-us/categories

    See the following for more information Microsoft article.

    http://blogs.msdn.com/b/securitytools/archive/2009/07/30/how-to-build-custom-logon-UI-s-in-Windows-Vista.aspx

    http://blogs.technet.com/b/Aho/archive/2009/11/15/custom-credential-provider-for-password-reset.aspx

    Keep us updated on the status of the issue.

  • Dialog box in the paint method

    I have an IllegalStackSizeException when I try to display a dialog box in the paint method.

    Here is an example:

    [Edit] Welcome to the forums! [/ Edit]

    Do you really need that Dialog.inform there? It's a very bad idea to have one any initiated interaction in paint, because it is called at unpredictable times. Worse still is the idea to execution of the painting of the block .

    If you absolutely, desperately need some user interface action will be initiated by paint (and frankly, you don't want to do), put it in invokeLater. Even if the painting is performed on the EventThread, you must leave the BB frame finish his current job, then come back and do something new.

    Dialog.Inform is a nice debugging tool, but it has its limits. You simply press one.

  • Displaying a dialog box to a background thread listening thrust

    Hi, my request has an Autostart entry point and a normal entry point. On Autostart, I start a thread to listen push. When this background process receives a msg to push, I want to display a dialog box to the user (from the background process). I tried many solutions I found on this forum and tried the code in this article: http://supportforums.blackberry.com/t5/Java-Development/Alert-a-BlackBerry-smartphone-user-from-a-Ba....

    When you use the code in the KB article, the unit freezes and I have to remove the battery...

    My application extends UIApplication, is there another way to do it?

    Thank you!

    Well, I managed to do work by creating a class that extends the Application of my background process and do enter the thread of events.

  • How to close the PrintDocument printing dialog box after pressing on it's Cancel button

    I develop using Windows 7, VB.net 2010 and dotnet 4.0.  The application is an x 86 application of Windows Forms using the PrintDocument class for printing.  After the call to PrintDocument.Print, the application manages the PrintDocument events and a print dialog box is displayed that indicates the number of pages that have been printed.  The print dialog box also includes a Cancel button.  I noticed that when a print job is canceled by using the Cancel button in the print dialog box, the print dialog box does not close until the underlying application closes.  When the compiled application is running, the application must close before to close the print dialog box.  When the application is running in the Visual Studio debugger, Visual Studio must close before to close the print dialog box.  The print dialog box also throws an error "a StartDocPrinter call was not issued" when you press the Cancel button.  Once you press the Cancel button, printing of dialogue "pages" message changes to "Cancel printing".

    Can someone tell me what I do wrong?

    The 'Microsoft community' focuses on the consumer.  You're more likely to get help in the MSDN forums or TechNet (links are on the forums to know which forum to post in).

    https://social.msdn.Microsoft.com/forums/en-us/home?Forum=whatforum&filter=AllTypes&sort=lastpostdesc

    https://social.technet.Microsoft.com/forums/en-us/home?Forum=whatforum&filter=AllTypes&sort=lastpostdesc

  • How to display the "Add a contact" dialog box with the non-empty fields?

    On the BlackBerry, I want to display a dialog box 'Add a contact' with some fields filled.

    I assumed would work the following code:

    Contact BlackBerryContact = mContactList.createContact ((BlackBerryContact));

    populateSomeFields (contact);

    AddressBookArguments args = new AddressBookArguments (AddressBookArguments.ARG_NEW, contact);

    Invoke.invokeApplication (Invoke.APP_TYPE_ADDRESSBOOK, args);

    but no way. If I invoke with ARG_NEW a completely EMPTY fields are displayed.

    If I invoke with ARG_COMPOSE an IllegalArgumentException is thrown. Is it possible that I can show 'Add a contact' with some informed fields?

    just as an idea: maybe you have to make contact before the opening of the new message notice?
    otherwise it is not possible, you will need to write your own GUI to change the fields in contacts.

  • How can I do to block the main thread when to display a dialog box

    I have a problem to block the user interface main thread when to display a dialog box (the dialog was created by the main Application), and when the dialog box is closed, the main Application can go to the next step.
    Here is my code:

    SerializableAttribute public class TitledPaneExample extends Application {}
    instance of TitledPaneExample private;
    StackPane mainModalDimmer;

    /*
    * (non-Javadoc)
    *
    * @see javafx.application.Application #start (javafx.stage.Stage)
    */
    @Override
    public void start (point primaryStage) bird Exception {}
    instance = this;
    primaryStage.setTitle (this.getClass () m:System.NET.SocketAddress.ToString ());

    final StackPane layerPane = new StackPane();
    layerPane.setDepthTest (DepthTest.DISABLE);
    layerPane.setStyle ("background - fx - color: BLACK ;"); ")

    Vb VBox = new VBox();
    vb.setStyle ("background - fx - color: BLUE ;"); ")
    vb.getChildren () .add new (Label ("1"));
    vb.getChildren () .add (Label ("2")) new;
    vb.getChildren () .add new (Label ("3"));
    vb.getChildren () .add (Label ("4")) new;

    Bt1 button = new Button ("bt1");
    BT1.setOnAction (new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent event)
    System.out.println ("bt1 trying to the new dialog box > > >");
    Dialogue di = new dialog box (instance, "some trick here!");
    System.out.println ("bt1 dialogue again successfully, try to show");
    di. Show();
    System.out.println ("bt1 dialog hide? < < < < ");"
    }
    });
    vb.getChildren () .add (bt1).

    layerPane.getChildren () .add (vb);

    mainModalDimmer = new StackPane();
    mainModalDimmer.setId ("MainModalDimmer");
    mainModalDimmer.setMaxSize (Double.MAX_VALUE, Double.MAX_VALUE);
    mainModalDimmer.setVisible (false);
    mainModalDimmer.setStyle ("background - fx - color: RED ;"); ")
    layerPane.getChildren () .add (mainModalDimmer);

    Scene sc = new scene (layerPane, 800, 600);
    primaryStage.setResizable (true);
    primaryStage.setScene (sc);
    primaryStage.show ();

    }

    /**
    * Display the node given as a floating dialog on the entire application, with
    * the rest of the application grayed out and blocked from mouse events.
    *
    @param message
    */
    {} public void showModalMessage (message from node)
    mainModalDimmer.getChildren () .add (message);
    mainModalDimmer.setOpacity (0);
    mainModalDimmer.setVisible (true);
    mainModalDimmer.setCache (true);
    TimelineBuilder
    . Create()
    () .keyFrames
    new KeyFrame (Duration.seconds (1),)
    new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent t)
    mainModalDimmer.setCache (false);
    }
    }, new KeyValue (mainModalDimmer
    . opacityProperty(), 1.
    Interpolator.EASE_BOTH))) infrastructure)
    . Play();
    }

    /**
    Hide the any modal message that appears
    */
    public void hideModalMessage() {}
    mainModalDimmer.setCache (true);
    TimelineBuilder
    . Create()
    () .keyFrames
    new KeyFrame (Duration.seconds (1),)
    new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent t)
    mainModalDimmer.setCache (false);
    mainModalDimmer.setVisible (false);
    mainModalDimmer.getChildren () .clear ();
    }
    }, new KeyValue (mainModalDimmer
    . opacityProperty(), 0,.
    Interpolator.EASE_BOTH))) infrastructure)
    . Play();
    }

    /**
    @param args
    */
    Public Shared Sub main (String [] args) {}
    Launch();
    }

    Dialogue/public class extends TitledPane {}
    private owner of TitledPaneExample = null;
    instance of TitledPane private;

    Dialogue (owner of TitledPaneExample, String message) {}
    This.Owner = owner;
    this.parentThreand = Thread.currentThread ();
    This.instance = this;
    this.setExpanded (true);
    this.setText ("Dialog");
    this.setMaxWidth (400);
    this.setPrefWidth (300);
    this.setMinWidth (200);

    Label the tx = new Label ("message");
    tx.setTooltip (new Tooltip (message));
    tx.setWrapText (true);
    tx.setContentDisplay (ContentDisplay.LEFT);

    Bt button = new Button ("OK");
    bt.setOnAction (new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent event)
    masquer();
    }
    });

    Sp ScrollPane = new ScrollPane();
    sp.setHbarPolicy (ScrollBarPolicy.AS_NEEDED);
    sp.setVbarPolicy (ScrollBarPolicy.AS_NEEDED);
    sp.setContent (tx);

    Hb HBox = new HBox (30);
    hb.setPrefHeight (40);
    hb.setAlignment (Pos.CENTER_RIGHT);
    hb.getChildren () .add (bt);

    BP BorderPane = new BorderPane();
    bp.setCenter (sp);
    bp.setBottom (hb);

    this.setContent (bp);
    }

    {} public void show()
    System.out.println ("dialogue show() 1 > > >");

    owner.showModalMessage (instance);

    System.out.println ("dialogue show() 2 > > >");

    }

    public void masquer() {}
    System.out.println ("dialogue masquer() 1 > > >");
    this.owner.hideModalMessage ();

    System.out.println ("dialogue masquer() 2 > > >");
    }
    }

    }

    I'm also interested in how to do this without the use of a step.

    But, if you are ready to use a step for this, you can create a useful first step (without borders) with its owner being your current stage. Then, you can call the function showAndWait on stage that allows to block the thread of your application. For example, I implemented a DialogStage like this:

    package hs.mediasystem.util;
    
    import javafx.animation.KeyFrame;
    import javafx.animation.KeyValue;
    import javafx.animation.Timeline;
    import javafx.event.EventHandler;
    import javafx.scene.effect.ColorAdjust;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import javafx.stage.Window;
    import javafx.stage.WindowEvent;
    import javafx.util.Duration;
    
    public class DialogStage extends Stage implements Dialog {
    
      public DialogStage() {
        super(StageStyle.TRANSPARENT);
    
        this.setTitle("MediaSystem-dialog");
    
        initModality(Modality.APPLICATION_MODAL);
      }
    
      protected void setParentEffect(Stage parent) {
        ColorAdjust colorAdjust = new ColorAdjust();
    
        Timeline fadeOut = new Timeline(
          new KeyFrame(Duration.ZERO,
            new KeyValue(colorAdjust.brightnessProperty(), 0)
          ),
          new KeyFrame(Duration.seconds(1),
            new KeyValue(colorAdjust.brightnessProperty(), -0.5)
          )
        );
    
        parent.getScene().getRoot().setEffect(colorAdjust);
    
        fadeOut.play();
      }
    
      protected void removeParentEffect(Stage parent) {
        parent.getScene().getRoot().setEffect(null);
      }
    
      protected void recenter() {
        Window parent = getOwner();
    
        sizeToScene();
    
        setX(parent.getX() + parent.getWidth() / 2 - DialogStage.this.getWidth() / 2);
        setY(parent.getY() + parent.getHeight() / 2 - DialogStage.this.getHeight() / 2);
      }
    
      @Override
      public final void showDialog(final Stage parent, boolean synchronous) {
        initOwner(parent);
    
        setParentEffect(parent);
    
        setOnShown(new EventHandler() {
          @Override
          public void handle(WindowEvent event) {
            recenter();
            onShow();
          }
        });
    
        if(synchronous) {
          showAndWait();
        }
        else {
          show();
        }
      }
    
      protected void onShow() {
      }
    
      @Override
      public void close() {
        removeParentEffect((Stage)getOwner());
        super.close();
      }
    }
    
  • Leave the dialog box change the text display/display

    I have a dialog box that is created with some text objects attached to its buttons. The user can make choices for each one, press OK, and asked of their choice. What I would like is for the buttons to the user in the text, so that they can see it in the context as they decide (that's the only reason why they are buttons; otherwise, they would be static text). I know how to handle this with a palette, but I wonder if there is a way to do it with a dialog box. With the help of a palette for all this seems unfair; I really don't want users to be able to make changes to the document, while the palette is open, and I don't want to change anything in the document until the user clicks OK. It is a dialogue with a palette as oddity, really.

    The problem is that. showText() and setting the activePage throw them the error "Cannot process the request because a modal dialog box or the alert is active." I tried to adjust the dialog box to .the = false or .visible = false, but it has no effect. Is it just impossible? This feature, change the view but not the content, seems to live in a grey zone between the way in which the work of dialog boxes and palettes of way work, so I don't know if I'm just a useless way. Any idea would be appreciated.

    Here's a code example to illustrate what I'm doing:

    #target indesign
    
    
    main();
    
    
    function main(){
        if (app.documents.length == 0){createTestDoc();}
        runDialog();
    }
    
    
    function createTestDoc(){
        //create a test document
        var myDocPre = app.documentPresets.add({name: "testPre", createPrimaryTextFrame: true, pagesPerDocument: 5});
        var myDoc = app.documents.add(true, myDocPre);
        var myPSty = myDoc.paragraphStyles.add({name: "newPageSty", startParagraph: StartParagraph.NEXT_PAGE});
        var myCSty = myDoc.characterStyles.add({name: "CSty", underline: true});
    
    
        myDoc.textFrames[0].contents = "1\r2\r3\r4\r5";
        myDoc.textFrames[0].texts.everyItem().appliedParagraphStyle = myPSty;
    
    
        app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
        app.findTextPreferences.findWhat = "^9";
        app.changeTextPreferences.appliedCharacterStyle = myCSty;
        myDoc.changeText();
    
    
        myDocPre.remove();
    }
    
    
    function runDialog(){
        //find text with a particular character style and send that text to my dialog creation function.
        var myDoc = app.activeDocument;
        var myCSty = myDoc.characterStyles.itemByName("CSty");
        if (myCSty.isValid){
            app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
            app.findTextPreferences.appliedCharacterStyle = myCSty;
            var myResults = myDoc.findText();
            myDialog(myResults);
        }
    }
    
    
    function myDialog(textRngs){
        //create the dialog.
        var myWin = new Window("dialog", "Test Dialog", undefined);
        var mainGroup = myWin.add("group");
        mainGroup.orientation = "column";
        //each text range gets a row.
        for (var i = 0; i < textRngs.length; i++){
            var myTextRng = textRngs[i];
            var myRow = mainGroup.add("group");
            myRow.orientation = "row";
            var myBut = myRow.add("button", undefined, myTextRng.contents);
            //attaches the text object to the button.
            myBut.targetObject = myTextRng;
            //does nothing - just a reminder that the actual dialog will do something at the end based on the info entered.
            myRow.add("editText");
            
            myBut.onClick = function(){
                //this is what I do when I want this functionality within a palette. Selects the text so that it can be seen in context.
                if (!(this.targetObject.hasOwnProperty("select") && this.targetObject.hasOwnProperty("showText"))) {}
                else{
                    this.targetObject.showText();
                    this.targetObject.select();
                    
                    //OR
                    //tried this as an alternative, but setting myWin.visible does nothing.
                    //myWin.visible = false;
                    //myDoc.layoutWindows[0].activePage = this.targetObject.parentTextFrames[0].parentPage;
                    //myWin.visible = true;
                }
            }        
        }
        var OKGrp = myWin.add("group");
        var OKBut = OKGrp.add("button", undefined, "OK");
        
        OKBut.onClick = function(){
            //do something
            myWin.close();
        }
        myWin.show();
    }
    

    You have no choice: If you want the script to interact with the text that you will need to use a palette.

    P.

  • File dialog box cut the default name

    Hi all

    I recently migrated from LV2011 to LV2012 and I have a problem with the dialog file Express vi. It seems, that in LV2012 the Windows dialog box that appears after invoking the file dialog box, adjust the default name to 14 characters (or rather the chain moves to the left so the first x characters are hidden). Please see screenshot attached screen and VI. It's OK in LV2011 (have tested the same code yesterday on another PC with LV2011). Is there a solution or the solution? This is a minor bug, but given that my application is distributed to a customer who pays it mind rather

    Thank you for your reply, Andrew!

    Your VI not exactly help me with my code, but it helped me to find the path . Unfortunately, when I used your VI, the behavior was exactly the same as with the file dialog box. But I noticed that it works only when I select 'create' to the function input terminal (with "create or replace" or something else I've known the cutting chain).

    Then I tried to override the setting of file express VI dialog box of 'New or existing' on 'New' with this setting, the file dialog box works very well (and there seems to be no difference between 'New or existing' and 'New').

    This problem is solved, thank you once more!

  • Displaying a dialog box when you open an application

    Hello

    I need to know is possible for me to show a dialog when the user opens my request?

    There will be an error when you put the code in the dialog box in the constructor.

    Does anyone of you have examples of code for this?

    Thanks in advance.

    I believe that by extracting the appropriate bits of the following three items, you should have enough information to be able to do it by yourself.

    How - to display a graphical interface to the BlackBerry device to start
    Article number: DB-00539

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/How_To _...

    It speaks of a GUI display to start the system, but the concepts are the same for the start of the application

    How - to create a splash screen
    Article number: DB-00119

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800256/...

    You shouldn't do this if you want to display a dialog box.

    How - to detect the availability of the system at boot
    Article number: DB-00642

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/How_to_-_Detec...

    It strengthens the arguments made in the other articles in the KB.

  • Dialog box of the file in the application that is running in window 7 shows all of the UNC path

    HELP PLZ!

    We use the file dialog box to open the folder of the disk file network hard. Window XP showed the path UNC path, but when we run our application (developed in vba) on window 7, full unc path has been established instead of only last name of the folder.
    example of... UNC path \\abcd\abb\abfolder in window XP file dialog shows "abfolder" and then if we see in looking in then hierarchical set of path can be seen
    but the file in window 7 dialog box shows all the way "\\abcd\abb\abfolde" as it is...
    Please suggest if some way where we can display in the file dialog box in the window 7 same folder in UNC path that showed before in XP.
    Hi Gary,

    Thanks for posting your question in the Microsoft Community forums.

    I see from the description of the problem, you have a problem with an application developed in Visual Basics for Applications running.

    The question you posted would be better suited in Visual Basics for Applications MSDN Forums. I would post the query in the link below.
    Hope this information helps you. If you need additional help or information on Windows, I'll be happy to help you. We, at tender Microsoft to excellence.
  • Dynamic buffers / Dialog Box with the context Menu (or list box)

    Hi people,

    I did experiment with stamps dynaimc for awhile and I got pretty far with this topic. I can not make it work are the context menus (or list boxes) in dialog boxes. The context menu is displayed correctly in the dialog box, but there is no content even though its meaning. The javascript of the definition of content looks like:

    It corresponds to a group of Popup in the PDF file named 'Test '.

    popupGroup: 'Test ',.

    listItems:

    [

    {popupItems:}

    {

    The list of items of the context menu, positive number indicates the default selection

    'Test 1': + 1,.

    'Test 2':-1.

    'Test 3':-1.

    "Test 4":-1,.

    'Test 5':-1

    }

    }

    ]

    You have no idea what's wrong with the code above?

    I did a quick check of your code, and there is a problem with an exception that is thrown in this line: return Collab.user;

    If you take this point, the code works correctly. Why do you use the Collab object?

  • Delete the "Missing fonts" dialog box during the execution of JavaScript

    Hello

    I develop a script (in JavaScript) which allows to convert all the InDesign files in a directory specified for PDF files. I'm running into a problem when I run the script because all InDesign files have missing links / fonts.  Therefore, a "Missing fonts" dialog box opens after each InDesign file opens.  I believe that because this dialog box is open, I get the error:

    "cannot process the request because a modal dialog box or the alert is active.

    Again, I'm assuming that my script does not work because the dialog box open "missing fonts.

    Is it possible to remove all the instructions of the user?  I've read some things about the levels of user interaction, however I have not found a way to settle this with JavaScript.

    I'd appreciate any help.

    Thank you!

    Hey!

    Try this:

    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    

    and on the finish to put this:

    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • How can I get a Web page to load dialog boxes after you click by mistake on "prevent this page from creating additional dialog boxes?

    I still need to be able to have dialogues load with the Web page. I'm not able to see all of the images on this site because by clicking on this button by mistake. Empty the cache does not solve the problem; Create my profile does not correct the problem. Firefox needs to address this issue, as it happens too many web apps.

    Jscher200... you rock! Real Player was the problem. I've uninstalled it. I'm not taking any chances for the part of the application on my system, and my Flash Slide show works perfectly well. I was running down the wrong alley because I assume a relationship between the snap of him "to prevent additional pages of execution of dialog boxes" and the absence of images via the Flash Player. Thank so much! Your tenacity and discipline helped me tremendously.

  • Dialog box States: the document is not valid. The xml index file is missing. What should I do?

    Tried to open a file of numbers. Dialog box shows: the invalid document___is. The xml index file is missing. I can retrieve this file? Suggestions?

    Yes, all you have to do is probably make sure you run the version of numbers which is located in your main Applications folder and open the document with this version.  Probably, you try to open it with the old version of numbers.

    SG

Maybe you are looking for