The below Tip describes you, How we can run/trigger external application directly from your Servoy Solution.
For triggering an External Application, You can use application.executeProgram() method. Here, I am quoting the syntax of the method.
//Execute a program and returns output specify the cmd as you would do in a console
var program_output = application.executeProgram( programName(fullpath), [arg1], [arg2], [argN],
[#], [environmentvar1], [environmentvarN], [#], [startdirectory]);
Where,
program Name : is the full path of the program to be executed.
arg1 – argN: Arguments passed to the program.
#: is the divider between program arguments.
Environmentvar1 – environmentvarN: environment variables passed to the program.
Startdirecory: directory from which your program start executing.
For an example, let’s start playing an audio file from your Servoy Application. The below code will do the same for you. It will automatically open the Windows Media Player and start playing the referenced audio file.
var fileURL = "C://Songs/Music.mp3";
application.executeProgram(‘C:/Program Files/Windows Media Player/wmplayer.exe’, fileURL);
You can also trigger the associated application according to the file protocol. So, according to the file type the default application associated with your underlying OS will open with your file referenced. The below code will do the same thing; It will start the Windows Media Player and start playing the referenced file. If in your OS, other application has set to default for opening audio file, then that application get triggered. This code only works in WINDOS Operating System.
var fileURL = “C://Songs/Music.mp3”;
application.executeProgram(‘rundll32’, ‘url.dll,FileProtocolHandler’, fileURL);