Launch MS Excel from within Ruby

Is it possible to launch an MS Excel file from within Ruby Script?

Ruby has multiple methods to run subprocesses in many ways - for example backtick (`), %x, system, IO.popen, exec, … They differ in how you have to manage the subprocess and how you get return values (if any). Be advised, though, that the way you phrase the command you give to these can determine whether Ruby (and hence all of SketchUp) will freeze until the command exits.

1 Like

In addition to the ruby meyhods, it can also be done from the sketchup API using the method: UI.openURL()

Which I believe is non-blocking.

1 Like
UI.openURL('file:///' + path_to_file)

this is the cross platform form, for opening in default application…


1 Like

They are overdue to update the API docs on this! It says it opens the URL in your default browser, not using the default app for the document type.