Launch weirdness

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Launch weirdness

Post by adventuresofgreg » Sat May 25, 2013 5:25 pm

Hi: I am using "Launch applicationpath.exe" to activate an autoHotKey macro to make various standalones the active window. It works fine - that is, WAS working fine until my latest standalone generation. Now each version of the launch application works once only - then won't work again. I can't figure out what would have happened to cause this to stop. Following is a better example of what is happening:

button 1: launch notepad.exe
button 2: launch explorer.exe
button 3: launch excel.exe

When I click on button 1, notepad is launched
when I click on button 2, explorer is launched
when I click on button 1 again, nothing happens
when I click on button 3, excel launches
when I click on button 1, or 2, or 3 nothing happens
, etc..

Any ideas?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Launch weirdness

Post by BvG » Sat May 25, 2013 5:29 pm

That's probably a silly question, but are you sure that you quit the launched apps before trying again? If they're already running, launch will not start them again, unless you specify a file.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

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

Re: Launch weirdness

Post by dunbarx » Sat May 25, 2013 5:32 pm

Is this not what you would expect? I am misunderstanding.

If the launched app is already open, relaunching will do nothing. The dictionary states:

If the application is already running, the launch command does nothing, and "Process is already open." is placed in the result function.

Like I said, misunderstanding...

Craig Newman

adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: Launch weirdness

Post by adventuresofgreg » Sat May 25, 2013 5:53 pm

The apps that are launching are macro standalone .exe files. They quit immediately after executing their macro. And these macro .exe's were all working as expected before. I made some changes to my LC standalone (nothing to do with the code that launches the macro exe's), and now this problem with relaunching is happening. It does seem like my LC standalone still 'thinks' that the macro .exe is still running, when it isn't. I know it isn't, because I can manually find the .exe, and launch it again by double clicking on the file in Windows. I could try to force my LC standalone to QUIT the launched .exe after it executes it's macro, but the "quit" function will quit the LC standalone, not the exe (I believe). Is there a way to "UNlaunch" an app in LC ?

adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: Launch weirdness

Post by adventuresofgreg » Sun May 26, 2013 2:16 pm

I switched to using the WIndows shell command, and the problem is solved. The shell command isn't as quick though... Still very strange that the 'launch' command was working before, and now won't. Is there a way to force a LC launched app to "unlaunch" and quit ?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Launch weirdness

Post by BvG » Sun May 26, 2013 10:17 pm

As far as I know the launch command is more picky about already running apps then windows (who happily launches a gazillion instances if ordered to). Launch has been known to behave a bit weirdly in some cases, but I thought those bugs got fixed some time ago.

As far as I know there's no way to "de-launch" an app. There is however the kill command.

Have you tried the "Launch document" approach?
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply