CAWT 2.9.1 Reference Manual

::ExplorerTop, Main, Index

The Explorer namespace provides commands to control the Internet Explorer browser.

Note: If running on Windows Vista or 7, you have to lower the security settings like follows:

CommandsTop, Main, Index

FullScreen [::Explorer]Top, Main, Index

Toggle the fullscreen mode of an Internet Explorer application window.

FullScreen appId onOff
appIdIdentifier of the Internet Explorer instance.
onOffIf set to true, use fullscreen mode. Otherwise use windowed mode.

Returns no value.

See also: Open, Visible

proc ::Explorer::FullScreen {appId onOff} {

    # Toggle the fullscreen mode of an Internet Explorer application window.
    #
    # appId - Identifier of the Internet Explorer instance.
    # onOff - If set to true, use fullscreen mode.
    #         Otherwise use windowed mode.
    #
    # Returns no value.
    #
    # See also: Open Visible

    $appId FullScreen [Cawt TclBool $onOff]
}

Go [::Explorer]Top, Main, Index

Go to a specific page.

Go appId target
appIdIdentifier of the Internet Explorer instance.
targetString identifying the target page.

Possible values for target are: Back, Forward, Home, Search.

Returns no value.

proc ::Explorer::Go {appId target} {

    # Go to a specific page.
    #
    # appId  - Identifier of the Internet Explorer instance.
    # target - String identifying the target page.
    #
    # Possible values for target are: `Back`, `Forward`, `Home`, `Search`.
    #
    # Returns no value.

    set cmd "Go$target"
    eval $appId $cmd
}

IsBusy [::Explorer]Top, Main, Index

Check, if an Internet Explorer instance is busy.

IsBusy appId
appIdIdentifier of the Internet Explorer instance.

Returns true or false dependent on the busy status.

proc ::Explorer::IsBusy {appId} {

    # Check, if an Internet Explorer instance is busy.
    #
    # appId - Identifier of the Internet Explorer instance.
    #
    # Returns true or false dependent on the busy status.

    return [expr {[$appId Busy]? true: false}]
}

Navigate [::Explorer]Top, Main, Index

Navigate to a URL or local file.

Navigate appId urlOrFile ?wait? ?targetFrame?
appIdIdentifier of the Internet Explorer instance.
urlOrFileURL or local file name (as an absolute pathname).
waitWait until page has been loaded completely. Optional, default true.
targetFrameName of the frame in which to display the resource. Optional, default _self.

The following predefined names for $targetFrame are possible:

_blankLoad the link into a new unnamed window.
_parentLoad the link into the immediate parent of the document the link is in.
_selfLoad the link into the same window the link was clicked in.
_topLoad the link into the full body of the current window.

If given any other string, it is interpreted as a named HTML frame. If no frame or window exists that matches the specified target name, a new window is opened for the specified link.

Returns no value.

See also: Open, OpenNew

proc ::Explorer::Navigate {appId urlOrFile {wait true} {targetFrame _self}} {

    # Navigate to a URL or local file.
    #
    # appId       - Identifier of the Internet Explorer instance.
    # urlOrFile   - URL or local file name (as an absolute pathname).
    # wait        - Wait until page has been loaded completely.
    # targetFrame - Name of the frame in which to display the resource.
    #
    # The following predefined names for $targetFrame are possible:
    # `_blank`  - Load the link into a new unnamed window.
    # `_parent` - Load the link into the immediate parent of the document the link is in.
    # `_self`   - Load the link into the same window the link was clicked in.
    # `_top`    - Load the link into the full body of the current window.
    #
    # If given any other string, it is interpreted as a named HTML frame.
    # If no frame or window exists that matches the specified target name,
    # a new window is opened for the specified link.
    #
    # Returns no value.
    #
    # See also: Open OpenNew

    $appId Navigate $urlOrFile 0 $targetFrame
    if { $wait } {
        while {[[$appId Document] readyState] != "complete"} {
            after 100
        }
    }
}

Open [::Explorer]Top, Main, Index

Open an Internet Explorer instance.

Open ?visible? ?width? ?height?
visibleIf set to true, show the application window. Otherwise hide the application window. Optional, default true.
widthWidth of the application window. If negative, open with last used width. Optional, default -1.
heightHeight of the application window. If negative, open with last used height. Optional, default -1.

Use an already running Internet Explorer, if available.

Returns the identifier of the Internet Explorer application instance.

See also: OpenNew, Quit, Visible

proc ::Explorer::Open {{visible true} {width -1} {height -1}} {

    # Open an Internet Explorer instance.
    #
    # visible - If set to true, show the application window.
    #           Otherwise hide the application window.
    # width   - Width of the application window. If negative, open with last used width.
    # height  - Height of the application window. If negative, open with last used height.
    #
    # Use an already running Internet Explorer, if available.
    #
    # Returns the identifier of the Internet Explorer application instance.
    #
    # See also: OpenNew Quit Visible

    variable explorerAppName

    set appId [Cawt GetOrCreateApp $explorerAppName true]
    Explorer Visible $appId $visible
    if { $width >= 0 } {
        $appId Width [expr $width]
    }
    if { $height >= 0 } {
        $appId Height [expr $height]
    }
    return $appId
}

OpenNew [::Explorer]Top, Main, Index

Open a new Internet Explorer instance.

OpenNew ?visible? ?width? ?height?
visibleIf set to true, show the application window. Otherwise hide the application window. Optional, default true.
widthWidth of the application window. If negative, open with last used width. Optional, default -1.
heightHeight of the application window. If negative, open with last used height. Optional, default -1.

Returns the identifier of the new Internet Explorer application instance.

See also: Open, Quit, Visible

proc ::Explorer::OpenNew {{visible true} {width -1} {height -1}} {

    # Open a new Internet Explorer instance.
    #
    # visible - If set to true, show the application window.
    #           Otherwise hide the application window.
    # width   - Width of the application window. If negative, open with last used width.
    # height  - Height of the application window. If negative, open with last used height.
    #
    # Returns the identifier of the new Internet Explorer application instance.
    #
    # See also: Open Quit Visible

    variable explorerAppName

    set appId [Cawt GetOrCreateApp $explorerAppName false]
    Explorer Visible $appId $visible
    if { $width >= 0 } {
        $appId Width [expr $width]
    }
    if { $height >= 0 } {
        $appId Height [expr $height]
    }
    return $appId
}

Quit [::Explorer]Top, Main, Index

Quit an Internet Explorer instance.

Quit appId
appIdIdentifier of the Internet Explorer instance.

Returns no value.

See also: Open

proc ::Explorer::Quit {appId} {

    # Quit an Internet Explorer instance.
    #
    # appId - Identifier of the Internet Explorer instance.
    #
    # Returns no value.
    #
    # See also: Open

    $appId Quit
}

Visible [::Explorer]Top, Main, Index

Toggle the visibility of an Internet Explorer application window.

Visible appId visible
appIdIdentifier of the Internet Explorer instance.
visibleIf set to true, show the application window. Otherwise hide the application window.

Returns no value.

See also: Open, OpenNew

proc ::Explorer::Visible {appId visible} {

    # Toggle the visibility of an Internet Explorer application window.
    #
    # appId   - Identifier of the Internet Explorer instance.
    # visible - If set to true, show the application window.
    #           Otherwise hide the application window.
    #
    # Returns no value.
    #
    # See also: Open OpenNew

    $appId Visible [Cawt TclInt $visible]
}