Launch external application

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

Launch external application

Post by link76 » Tue Jan 14, 2014 9:34 am

Hello,
I would like to launch an external application but do not work when insert the parameters

it work

Code: Select all

put the effective filename of this stack into tPath
set itemdelimeter to slash
delete last item of tPath
launch document "traspunto.exe"
it not work

Code: Select all

put the effective filename of this stack into tPath
set itemdelimeter to slash
delete last item of tPath
launch document "traspunto.exe p pia geo c 5032636 516047 WGS84 32 >res.txt"
the syntax of application traspunto.exe (traspunto.exe p pia geo c 5032636 516047 WGS84 32 >res.txt) is correct launched in command line

thank you

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Launch external application

Post by Klaus » Tue Jan 14, 2014 12:49 pm

Hi,

obviously "launch" does not accept any parameters or does not supprt them at all.
So you may need to use "shell" to open your app with paramters.


Best

Klaus

link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

Re: Launch external application

Post by link76 » Tue Jan 14, 2014 1:50 pm

Klaus wrote:Hi,

obviously "launch" does not accept any parameters or does not supprt them at all.
So you may need to use "shell" to open your app with paramters.


Best

Klaus
it not work:

Code: Select all

put the effective filename of this stack into tPath
set itemdelimeter to slash
delete last item of tPath
put shell(tPath&"\traspunto.exe p pia geo c 5032636 516047 WGS84 32 >res.txt")

thank you

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Launch external application

Post by Klaus » Tue Jan 14, 2014 2:08 pm

I'm no expert in Windows shell scripting, but try this:

Code: Select all

...
put the effective filename of this stack into tPath
set itemdelimeter to "/"
put "traspunto.exe" into item -1 of tPath

## WINDOWS path delimiter!!!!!!
replace "/" with "\" in tPath
get shell(tPath && "p pia geo c 5032636 516047 WGS84 32 >res.txt")
put IT & CR & the RESULT
## Maybe this gives a hint in case it does not work?
... 
>res.txt -> Do you have write permission in the folder with the stack?


Best

Klaus

Post Reply