Invoking an application

Hi,

I am new to eggplant,could you please tell me if there is any script available to invoke an application or browser like Internet Explore,if so how.

Also how to close an application.

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    The rule of thumb in eggPlant is that you write scripts to do things the same way a user would do them. The only shortcuts available are the shortcuts a user has, such as keyboard commands. How you open or close an application will depend on what operating system you are scripting against. If you want to open an application on a Mac, the following script works well:
    typeText F11 -- show desktop
    Click (150,150) -- click desktop to select finder
    TypeText shiftKey, commandKey, "a" -- shortcut to Applications folder
    TypeText "ApplicationName" -- type the app name to select it
    TypeText commandkey, "o" -- use command + o to open it
    
    You could make this its own script and make the application name a parameter so you could call it anytime you wanted to open an application on the remote system.

    To open an application on Windows, you can write a script that clicks the Start menu, then Programs, and the name of the application. Or you can write a script that triggers the Run command and then types the application name and the Enter key. Here's an example of a script that you can call to launch Internet Explorer with a specified URL:
    params urlToLoad
    
    TypeText windowsKey, "r" -- open the Run window
    TypeText  "iexplore" && quote & urlToLoad & quote & return
    

    Closing an application is done by scripting the quit either by scripting the keyboard shortcut, e.g.:
    TypeText altKey, "f"
    TypeText "x" //most Windows apps
    
    or by clicking the close button on the window.
  • Thank you Matt,it helped a lot
Sign In or Register to comment.