Use the function SysSetObjectData twice if you want to open an object and run it in the foreground:
/* ID of the object */ objectID = "<WP_SYSED>" /* open the object ... */ objectOpen = SysSetObjectData( objectID, "OPEN=DEFAULT;" ) /* ... and bring it in the foreground */ if objectOpen = 1 then objectOpen = objectOpen + , SysSetObjectData( objectID, "OPEN=DEFAULT;" ) /* now the value of the variable objectOpen is */ /* 2 if the object is open and in the foreground, */ /* 1 if the object is open in the background and */ /* 0 if we couldn't open the object */
Note that the value for the key CCVIEW in the settings of the object must be NO to make this work (otherwise the second call of SysSetObjectData would open a new window).