# IRiSystemCommand Interface Reference

Inherits IDispatch, and IDispatch.

List of all members.

## Public Member Functions
HRESULT | Trace ([in] BSTR bsText)
HRESULT | Alert ([in] BSTR bsText)
HRESULT | Fatal ([in] BSTR bsText)
HRESULT | Error ([in] BSTR bsText)
HRESULT | Warning ([in] BSTR bsText)
HRESULT | Info ([in] BSTR bsText)
HRESULT | CreateDO ([in] BSTR idName,[out, retval] VARIANT *pVal)
HRESULT | CloneDO ([in] VARIANT vDO,[out, retval] VARIANT *pVal)
HRESULT | ThisName ([out, retval] BSTR *pVal)
HRESULT | ThisOwner ([out, retval] BSTR *pVal)
HRESULT | GetMainDir ([out, retval] BSTR *pVal)
HRESULT | SetBusyCursor ([in] RtBOOL bBusy)
HRESULT | SendCommandLine ([in] BSTR bsScriptLine)
HRESULT | Question ([in] BSTR bsText,[out, retval] VARIANT_BOOL *pVal)
HRESULT | Trace ([in] BSTR bsText)
HRESULT | Alert ([in] BSTR bsText)
HRESULT | Fatal ([in] BSTR bsText)
HRESULT | Error ([in] BSTR bsText)
HRESULT | Warning ([in] BSTR bsText)
HRESULT | Info ([in] BSTR bsText)
HRESULT | CreateDO ([in] BSTR idName,[out, retval] VARIANT *pVal)
HRESULT | CloneDO ([in] VARIANT vDO,[out, retval] VARIANT *pVal)
HRESULT | ThisName ([out, retval] BSTR *pVal)
HRESULT | ThisOwner ([out, retval] BSTR *pVal)
HRESULT | GetMainDir ([out, retval] BSTR *pVal)
HRESULT | SetBusyCursor ([in] RtBOOL bBusy)
HRESULT | SendCommandLine ([in] BSTR bsScriptLine)
HRESULT | Question ([in] BSTR bsText,[out, retval] VARIANT_BOOL *pVal)

## Detailed Description

The IRiSystemCommand interface provides core methods for all script objects and commands. For script objects this is the only accessible command interface. The interface consists of base debug, output, identification and constructor methods.
Root-level name in the scripting engine's name space: System

## Member Function Documentation

HRESULT IRiSystemCommand::Trace | ( | [in] BSTR | bsText | ) |

Basic console output (suitable for script debug purposes).

Parameters:

  | bsText | [in] Text to be send to the output console.

     System.Trace("Honk if you jScript");

HRESULT IRiSystemCommand::Alert | ( | [in] BSTR | bsText | ) |

Basic alert message box output.

Parameters:

  | bsText | [in] Text to be displayed in modal message box.

     System.Alert(Node.FirstSelected());

HRESULT IRiSystemCommand::Fatal | ( | [in] BSTR | bsText | ) |

Fatal error reporting (will terminate trueSpace as well, so use only in special occasions).

Parameters:

  | bsText | [in] Text to be displayed in fatal error message box.

     System.Fatal("opps a crash");

HRESULT IRiSystemCommand::Error | ( | [in] BSTR | bsText | ) |

Non-fatal error reporting (error box and logfile entry).

- Check install directory: Rosetta.log file for log entry.

Parameters:

  | bsText | [in] Text to be displayed in error message box.

     System.Error("Something went wrong");

HRESULT IRiSystemCommand::Warning | ( | [in] BSTR | bsText | ) |

Warning reporting (logfile entry only, no msg box).

- Check install directory: Rosetta.log file for log entry.

Parameters:

  | bsText | [in] Text to be displayed in warning logfile entry.

     System.Warning("this is just a test");

HRESULT IRiSystemCommand::Info | ( | [in] BSTR | bsText | ) |

Info message reporting (logfile entry only, no msg box).

- Check install directory: Rosetta.log file for log entry.

Parameters:

  | bsText | [in] Text to be displayed in info logfile entry.

     System.Info("FYI only");

HRESULT IRiSystemCommand::CreateDO | ( | [in] BSTR | idName,
|  | [out, retval] VARIANT * | pVal |
| ) |  |  |

Create new data object instance of given type.

Parameters:

  | idName | [in] Identification of data object to be created (e.g. 'Common Data Package/Color Data').

Returns:
  pVal [out,retval] Returned data object instance.

     var dObj = System.CreateDO('Common Data Package/Bitmap Data');

HRESULT IRiSystemCommand::CloneDO | ( | [in] VARIANT | vDO,
|  | [out, retval] VARIANT * | pVal |
| ) |  |  |

Clone existing data object instance.

Parameters:

  | vDO | [in] Data object instance to be cloned.
  | pVal | [out,retval] Returned data object instance clone.

        var dObj = System.CreateDO('Common Data Package/Bitmap Data');
        var cloneObj = System.CloneDO(dObj);

HRESULT IRiSystemCommand::ThisName | ( | [out, retval] BSTR * | pVal | ) |

Returns full name of the caller object (suitable for script objects e.g. to access sub-objects of itself).

Returns:
  pVal [out,retval] Returned full name.

        var me = System.ThisName;
        System.Alert(me);

HRESULT IRiSystemCommand::ThisOwner | ( | [out, retval] BSTR * | pVal | ) |

Returns full name of the caller's owner object name (suitable for script objects e.g. to access neighbour objects).

Returns:
  pVal [out,retval] Returned owner full name.

        var owner = System.ThisOwner();
        System.Alert(owner);

HRESULT IRiSystemCommand::GetMainDir | ( | [out, retval] BSTR * | pVal | ) |

Returns main application directory (full disk path).

Returns:
  pVal [out,retval] Returned directory.

        var myDir= System.GetMainDir;
        System.Alert(myDir);

HRESULT IRiSystemCommand::SetBusyCursor | ( | [in] RtBOOL | bBusy | ) |

Set or reset busy mouse cursor (suitable e.g. for heavy computation cases).

Parameters:

  | bBusy | [in] Boolean true or false.

     System.SetBusyCursor(true);

HRESULT IRiSystemCommand::SendCommandLine | ( | [in] BSTR | bsScriptLine | ) |

Performs asynchronous (safe) command call using script line.

Parameters:

  | bsScriptLine | [in] String text of the script/command to send.

     System.SendCommandLine('System.Alert("help")');

HRESULT IRiSystemCommand::Question | ( | [in] BSTR | bsText,
|  | [out, retval] VARIANT_BOOL * | pVal |
| ) |  |  |

Basic question box, returning user's answer.

Parameters:

  | bsText | [in] Text to be displayed in modal question box.
  | pVal | [out,retval] Returned 'true'(1) if user answered with Yes button, false (0) otherwise.

        var quest = System.Question('Are you ready?');
        System.Alert(quest);

HRESULT IRiSystemCommand::Trace | ( | [in] BSTR | bsText | ) |

Basic console output (suitable for script debug purposes).

Parameters:

  | bsText | [in] Text to be send to the output console.

     System.Trace("Honk if you jScript");

HRESULT IRiSystemCommand::Alert | ( | [in] BSTR | bsText | ) |

Basic alert message box output.

Parameters:

  | bsText | [in] Text to be displayed in modal message box.

     System.Alert(Node.FirstSelected());

HRESULT IRiSystemCommand::Fatal | ( | [in] BSTR | bsText | ) |

Fatal error reporting (will terminate trueSpace as well, so use only in special occasions).

Parameters:

  | bsText | [in] Text to be displayed in fatal error message box.

     System.Fatal("opps a crash");

HRESULT IRiSystemCommand::Error | ( | [in] BSTR | bsText | ) |

Non-fatal error reporting (error box and logfile entry).

- Check install directory: Rosetta.log file for log entry.

Parameters:

  | bsText | [in] Text to be displayed in error message box.

     System.Error("Something went wrong");

HRESULT IRiSystemCommand::Warning | ( | [in] BSTR | bsText | ) |

Warning reporting (logfile entry only, no msg box).

- Check install directory: Rosetta.log file for log entry.

Parameters:

  | bsText | [in] Text to be displayed in warning logfile entry.

     System.Warning("this is just a test");

HRESULT IRiSystemCommand::Info | ( | [in] BSTR | bsText | ) |

Info message reporting (logfile entry only, no msg box).

- Check install directory: Rosetta.log file for log entry.

Parameters:

  | bsText | [in] Text to be displayed in info logfile entry.

     System.Info("FYI only");

HRESULT IRiSystemCommand::CreateDO | ( | [in] BSTR | idName,
|  | [out, retval] VARIANT * | pVal |
| ) |  |  |

Create new data object instance of given type.

Parameters:

  | idName | [in] Identification of data object to be created (e.g. 'Common Data Package/Color Data').

Returns:
  pVal [out,retval] Returned data object instance.

     var dObj = System.CreateDO('Common Data Package/Bitmap Data');

HRESULT IRiSystemCommand::CloneDO | ( | [in] VARIANT | vDO,
|  | [out, retval] VARIANT * | pVal |
| ) |  |  |

Clone existing data object instance.

Parameters:

  | vDO | [in] Data object instance to be cloned.
  | pVal | [out,retval] Returned data object instance clone.

        var dObj = System.CreateDO('Common Data Package/Bitmap Data');
        var cloneObj = System.CloneDO(dObj);

HRESULT IRiSystemCommand::ThisName | ( | [out, retval] BSTR * | pVal | ) |

Returns full name of the caller object (suitable for script objects e.g. to access sub-objects of itself).

Returns:
  pVal [out,retval] Returned full name.

        var me = System.ThisName;
        System.Alert(me);

HRESULT IRiSystemCommand::ThisOwner | ( | [out, retval] BSTR * | pVal | ) |

Returns full name of the caller's owner object name (suitable for script objects e.g. to access neighbour objects).

Returns:
  pVal [out,retval] Returned owner full name.

        var owner = System.ThisOwner();
        System.Alert(owner);

HRESULT IRiSystemCommand::GetMainDir | ( | [out, retval] BSTR * | pVal | ) |

Returns main application directory (full disk path).

Returns:
  pVal [out,retval] Returned directory.

        var myDir= System.GetMainDir;
        System.Alert(myDir);

HRESULT IRiSystemCommand::SetBusyCursor | ( | [in] RtBOOL | bBusy | ) |

Set or reset busy mouse cursor (suitable e.g. for heavy computation cases).

Parameters:

  | bBusy | [in] Boolean true or false.

     System.SetBusyCursor(true);

HRESULT IRiSystemCommand::SendCommandLine | ( | [in] BSTR | bsScriptLine | ) |

Performs asynchronous (safe) command call using script line.

Parameters:

  | bsScriptLine | [in] String text of the script/command to send.

     System.SendCommandLine('System.Alert("help")');

HRESULT IRiSystemCommand::Question | ( | [in] BSTR | bsText,
|  | [out, retval] VARIANT_BOOL * | pVal |
| ) |  |  |

Basic question box, returning user's answer.

Parameters:

  | bsText | [in] Text to be displayed in modal question box.
  | pVal | [out,retval] Returned 'true'(1) if user answered with Yes button, false (0) otherwise.

        var quest = System.Question('Are you ready?');
        System.Alert(quest);