ssCore.Shell.invoke

Open a document or resource using the associated application (from the Windows registry). If the document or resource specified by the path argument has no registered association, it will be passed to the default browser.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

path - A fully qualified path to the document that will be the target of the shell verb. This parameter supports monikers.

verb - [Optional] - The verb to be applied to the document. If no verb is specified, the default verb will be used.

openAs - [Optional] - Ignore the document extension and attempt to open the document as if it ended in this extension.

useFileExts - [Optional] - A boolean value that determines whether user registered file extensions will be used instead of the system and application defaults. If not specified, a default of false will be used. Valid values include: true and false.

timeout - [Optional] - Maximum amount of time in milliseconds SWF Studio should wait for the application used to open the document or resource to complete (waitForExit) or start (waitForWindow). If not specified (or 0) the timeout is infinite. We recommend using 0 with waitForExit and a resonable delay (e.g. 15 seconds) to allow the application to start when using waitForWindow.

waitForWindow - [Optional] - A boolean value that indicates whether you want to wait for the application's main window to appear or not (splash screens are ignored). Valid values include: true and false.

waitForExit - [Optional] - A boolean value that indicates whether you want to wait for the application to complete or not. This argument is required if you want to retrieve the Exit Code. Valid values include: true and false.

topmost - [Optional] - A boolean value that indicates whether the application should be made the topmost window. Valid values include: true and false.

x - [Optional] - X coordinate where the new window should be displayed.

y - [Optional] - Y coordinate where the new window should be displayed.

width - [Optional] - Width of the new window.

height - [Optional] - Height of the new window.

forceChild - [Optional] - A boolean value that, when true, forces the new document window to be opened as a child of the player window instead of as a normal window. Note: Some applications may not behave as expected when forced to become the child of another application.


Output Parameters:

elapsed - Elapsed time (in milliseconds) from the application startup to shutdown (run time) if you are using waitForExit or the elapsed time until application startup (launch time) if you are using waitForWindow.

hwnd - The window handle of the application. You must use the waitForWindow flag if you want a window handle returned. Not all applications return window handles (you may have to test your application to determine this).

exitCode - The exit code returned by the application. Not all applications return exit codes (you may have to test your application to determine this).


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Shell.invoke( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Shell.invoke( paramsObject );


Notes:

None.


Examples:

ssCore.Shell.invoke({path:"startdir://file.pdf", topmost:true});