All functions return an error code < 0 in case of problems. You can use iimGetLastError to retrieve the text associated with the last error. A list of return codes is available here.
int ret_code = iimDisplay ( String message [, int timeout] ) Displayes a short message in the iMacros browser.
int ret_code = iimExit ( [int timeout] ) Closes the iMacros browser.
String err_message = iimGetLastError ( ) Returns the text associated with the last error.
String extract = iimGetLastExtract ( ) Returns the contents of the !EXTRACT variable.
int ret_code = iimInit( String command_line [, boolean start_browser] [, String run_as_user, String run_as_password, String run_as_domain] ) Initializes the Scripting Interface. int ret_code = iimPlay ( String macro [, int timeout] ) Plays a macro.
int ret_code = iimSet ( String var_string, String var_value ) Assigns values to variables.