Launch another application with Launch command

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Launch another application with Launch command

Post by mrcoollion » Wed Nov 16, 2016 5:08 pm

I am trying to make a stack that launches another application.
Seems to be easy but no luck so far.

Can anybody tell me what I am doing wrong?

I attached an ApplicationLauncher and AppToLaunch stacks for testing.

Regards,

Paul
Attachments
LaunchAppStacks.zip
App launcher and app to launch stacks
(2.53 KiB) Downloaded 229 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10351
Joined: Wed May 06, 2009 2:28 pm

Re: Launch another application with Launch command

Post by dunbarx » Wed Nov 16, 2016 5:17 pm

Hi.

I did not open your stack, but try this:

Code: Select all

on mouseUp
   answer file "xyz"
   launch it
   put the result
end mouseUp
This gives a valid pathname. I bet you did not. LC needs one to know what to launch and where to launch from.

About that "put the result" line. Add it after the launch line and see if it says something like "no such program". There might well be such a program, but it cannot be found.

Craig
Last edited by dunbarx on Wed Nov 16, 2016 5:19 pm, edited 1 time in total.

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

Re: Launch another application with Launch command

Post by Klaus » Wed Nov 16, 2016 5:18 pm

Hi Paul,

if you want to start an APPLICATION ('.EXE on Win, '.APP on Mac) then "launch pathto_exe.exe" will do.
But you want to:
...
launch DOCUMENT "path/to_the/stack.livecode"
...

Best

Klaus

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Launch another application with Launch command

Post by mrcoollion » Wed Nov 16, 2016 5:34 pm

Strange enough my stack work now without any change :shock:

Does this also work in android?
I am working baby steps towards starting an application in android and communicate with it (via sockets)

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

Re: Launch another application with Launch command

Post by Klaus » Wed Nov 16, 2016 6:19 pm

mrcoollion wrote:Strange enough my stack work now without any change :shock:
Use "launch document ..." and it will always work reliably!
And don't use "file://" as in your example stack!

And for the sake of clarity in the terminology: stack <> application!

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Launch another application with Launch command

Post by mrcoollion » Wed Nov 16, 2016 11:58 pm

Thanks Klaus. And Stack <> application ... got it :lol:

Post Reply