Author Topic: Launch Executables within a script  (Read 3707 times)

mariocup

  • Guest
Launch Executables within a script
« on: March 20, 2007, 04:18:25 pm »
Hi Guys,

I want to add a new script, so I took the sample script and made some modifications.
The script is enabled and registerd with the option "Launch executables" in the security tab.

The following code adds a menu entry and then external application should be started.
Code
function GetMenu()
{
local entries = ::wxArrayString();
entries.Add(_T("mymenu/explorer"),1);
retrurn entries;
}

function OnMenuClicked(index)
{
switch (index)
{
case 0:
local executing = _T("explorer.exe");
::ShowMessage(executing);
local retval = IO.Execute(executing);
// local retval = IO.ExecuteAndGetOutput(executing);
break;
...

In my case only the ShowMessage appears, but no external application starts. What I am doing wrong?

Thanks.

Mario

DonSixto

  • Guest
Re: Launch Executables within a script
« Reply #1 on: March 22, 2007, 04:59:05 pm »
What happens with ::wxExecute ?
I looks like a search path problem.
Try with "c:\\windows\\explorer.exe" or wherever win is installed.


mariocup

  • Guest
Re: Launch Executables within a script
« Reply #2 on: March 22, 2007, 05:30:59 pm »
Hi DonSixto,

I tried you modification but the application is not started. How can I use ::wxExecute within a script?

Thx,

Mario

DonSixto

  • Guest
Re: Launch Executables within a script
« Reply #3 on: March 22, 2007, 05:37:15 pm »
Assuming that IO.Execute is right, then your interpreter is configured not to let lauch external programs, specially if it is run inside a web browser.
What language is it ?  It looks like a .net app.

mariocup

  • Guest
Re: Launch Executables within a script
« Reply #4 on: March 22, 2007, 05:43:10 pm »
The language is called squirrel (http://squirrel-lang.org)

It is a strange behaviour. If I call external applications like insight (the executable is in $PATH)  the IO.ExecuteAndGetOutput(executing) works within a script. Other executables like explorer that are also in $PATH, are not started.