Open a Web Page

This process will prompt the user enter a URL. It will then launch this URL, using Internet Explorer.

Display.InputDialog Title:'Enter the URL.' /
                    Message:'Please enter the URL of the webpage that you want to launch.' \
                    DefaultValue:'' InputType:Display.InputType.SingleLine \
                    IsTopMost:False \
                    UserInput=> UserInput \
                    ButtonPressed=> ButtonPressed

if (ButtonPressed='OK') then
                System.RunApplication ApplicationPath:'iexplore' \
                    CommandLineArguments:UserInput \
                    WorkingDirectory:'' \
                    WindowStyle:System.ProcessWindowStyle.Normal \
                    ProcessId=> ProcessId

end

Display.ShowMessage Title:'Example Completed!' \
                    Message:'Example "Open Web Page" completed.' \
                    Icon:Display.Icon.None Buttons:Display.Buttons.OK \
                    DefaultButton:Display.DefaultButton.Button1 \
                    IsTopMost:False \
                    ButtonPressed=> ButtonPressed

In more detail:


The process will display a message prompting the user to enter the URL of the web page that they want to launch. Then it checks whether the user has pressed the “OK” button. If so, it will launch the URL, using Internet Explorer. In the end, a message will be displayed to inform the user that the process is completed. 

Step 1: Prompt the user to enter a URL

Prompt the user to enter the URL of the web page that they want to launch.

Display.InputDialog Title:'Enter the URL.' \
                    Message:'Please enter the URL of the webpage that you want to launch.' \
                    DefaultValue:'' \
                    InputType:Display.InputType.SingleLine \
                    IsTopMost:False \
                    UserInput=> WebPageToLaunch \
                    ButtonPressed=> ButtonPressed

Use the “Display.SelectFile” action:

  1. Set the “Title” argument to “Enter the URL”.
  2. Set the “Message” argument to “Please enter the URL of the webpage that you want to launch”.
  3. Change the output variable’s name from “UserInput” to “WebPageToLaunch”.

Step 2: Check whether the OK button was pressed

CCheck whether the user pressed the OK button. If so, launch the URL, using the Internet Explorer.

if (ButtonPressed='OK') then
                    System.RunApplication ApplicationPath:'iexplore' \
                    CommandLineArguments:WebPageToLaunch \
                    WorkingDirectory:'' \
                    WindowStyle:System.ProcessWindowStyle.Normal \
                    ProcessId=> ProcessId
end
  1. Use the “if” statement to check whether the user pressed the “Open” button in the previous dialog box.
  2. Use the “System.RunApplication” action:
    1. Set the “AppicationPath” argument to “iexplore”.
    2. Set the “CommandLineArguments”to “WebPageToLaunch” which is the output variable of the “Display.InputDialog” action (used in the first step).
    3. Close the conditional block, using the “end” statement.
  3. Close the conditional block, using the “end” statement.

In case there is no URL given, the process will launch the home page.

Step 3: Display a message when the process is completed

Inform the user when the process is completed.

Display.ShowMessage Title:Process Completed!' \

                    Message:'Process "Open Web Page" completed.' \
                    Icon:Display.Icon.None \
                    Buttons:Display.Buttons.OK \
                    DefaultButton:Display.DefaultButton.Button1 \
                    IsTopMost:False \
                    ButtonPressed=> ButtonPressed

Use the “Display.ShowMessage” action:

  1. Set the “title” argument to “Process Completed!”.
  2. Set the “Message” argument to “‘Open Web Page’ completed”.