iimExit()

From iMacros

(Redirected from iimExit)
Jump to: navigation, search

Closes the iMacros browser. It first attempts to close the browser by sending it a direct message. If the browser does not react (e.g. because the website made the browser freeze) then it terminates the browser. Thus, the Scripting Engine will keep control even if the browser itself is "frozen".

A list of return codes is available here [1].

For use with Firefox we suggest to disable the Firefox session recovery feature. This avoids a dialog if iimExit has to terminate Firefox.

Syntax

int ret_code = iimExit ( [int timeout] )

Return values:

1 : OK (Brower closed itself after receiving the command)

< 0: iimExit had to terminate the browser (This can happen, for example, if the browser is frozen or does not respond back to iimExit in time).

Parameters

int timeout

The optional timeout value determines when the Scripting Interface returns a timeout error if the command is not completed in time. The default value is 3 seconds.

Examples

Visual Basic Script example:

Dim imacros, iret
Set imacros = CreateObject("imacros")
iret = imacros.iimInit()
iret = imacros.iimPlay("mymacro")
iret = imacros.iimExit()
Personal tools