Execute A Program

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Execute A Program

Post by Googie85 » Sat Sep 26, 2020 5:35 am

Hi Guys,

I am seeking another way of running a program aside from this:

get shell("start C:\Windows\Temp\Console.exe")

Any Ideas??

Many Thanks,

Matt.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10204
Joined: Fri Feb 19, 2010 10:17 am

Re: Execute A Program

Post by richmond62 » Sat Sep 26, 2020 8:14 am

I tend to run programs by double-clicking symbolic links on the desktop.

Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Re: Execute A Program

Post by Googie85 » Sat Sep 26, 2020 8:59 am

Why be smart??

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10065
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Execute A Program

Post by FourthWorld » Sat Sep 26, 2020 9:04 am

Have you tried the launch command?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10204
Joined: Fri Feb 19, 2010 10:17 am

Re: Execute A Program

Post by richmond62 » Sat Sep 26, 2020 9:06 am

Googie85 wrote:
Sat Sep 26, 2020 8:59 am
Why be smart??
Well, for starters because you probably asked the wrong question.

What I believe you should have asked goes a bit like this:

"How can I launch a Windows program from inwith LiveCode without using a shell command."

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10065
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Execute A Program

Post by FourthWorld » Sat Sep 26, 2020 10:07 am

richmond62 wrote:
Sat Sep 26, 2020 9:06 am
"How can I launch a Windows program from inwith LiveCode without using a shell command."
This being a LiveCode forum, that's how I inferred the question.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10204
Joined: Fri Feb 19, 2010 10:17 am

Re: Execute A Program

Post by richmond62 » Sat Sep 26, 2020 10:47 am

This being a LiveCode forum, that's how I inferred the question.
Well, you are obviously privy to some information which I am not. 8)

Given the number of totally out-of-context spam messages that keep turning up hereabouts, I . . . :?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10065
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Execute A Program

Post by FourthWorld » Sat Sep 26, 2020 10:54 am

When in doubt look at a user"s profile. Googie85 has been a part of this community for quite a while, as has contributed to a great many meaningful discussions.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10204
Joined: Fri Feb 19, 2010 10:17 am

Re: Execute A Program

Post by richmond62 » Sat Sep 26, 2020 10:59 am

When in doubt look at a user"s profile.
Thanks: I'll remember that in future.

marco.deepak
Posts: 11
Joined: Fri Oct 02, 2020 10:24 am

Re: Execute A Program

Post by marco.deepak » Mon Oct 12, 2020 10:24 am

In my windows application I run a batch file by pressing a button.
I use the following code:

Code: Select all

on mouseUp
   answer"prompt text"with"closing button text"
   launch document "complete Path"
end mouseUp
Maybe it works also with exe files?.

Hope it helps

M.

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: Execute A Program

Post by AxWald » Mon Oct 12, 2020 1:17 pm

Hi,
marco.deepak wrote:
Mon Oct 12, 2020 10:24 am
Maybe it works also with exe files?
Sure it does:

Code: Select all

launch "notepad.exe"
Works.

Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 939
Joined: Thu Nov 13, 2008 6:48 am

Re: Execute A Program

Post by marksmithhfx » Thu Oct 23, 2025 1:24 pm

I know I am revisiting old material I once knew but have since forgotten (and for which Google Search was no help). I've just started a new stack, opened a card and plunked a whole bunch of code in the card which had numerous errors, which I have now corrected. I'd like to run this script, but short of saving the stack to disk and launching it from the finder is there a "Run" command, or keyboard shortcut that will run the current script? I should add, there is no UI in the stack yet and the UI code is supposed to be in the script.

Just wondering. I think in the past someone had mentioned a clever way to do this but I've forgotten.

Best,
Mark
macOS 15.6 (Sequola), Xcode 15.3, LC 10.0.2, iOS 18.6.2

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 939
Joined: Thu Nov 13, 2008 6:48 am

Re: Execute A Program

Post by marksmithhfx » Thu Oct 23, 2025 8:36 pm

Responding to my own question re: executing a program. Snooping around a bit I found 2 possibilities: start using stack "stack name" or go stack "start name" and I'm not quite sure of the difference between the two. However, in the current version of LC 10 (.0.2) when I type either into the msg box and press return nothing happens. However if I close the msg box and reopen it, it seems to execute the expected code. Do I have that right?

Thanks
macOS 15.6 (Sequola), Xcode 15.3, LC 10.0.2, iOS 18.6.2

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

Re: Execute A Program

Post by dunbarx » Thu Oct 23, 2025 8:58 pm

Hi.

Are you asking how to "use" a stack within LC? All the chatter here seemed to me to indicate that you wanted to open other applications from within LC, but not run LC from within LC. "launch" is your friend there.

But this latest:
start using stack "stack name" or go stack "stackName" ...
Threw me.

"Start using" a stack places its stack script into the message path. "Go stack" navigates to a stack.

I do not understand at all what you are asking to do.

Craig

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 939
Joined: Thu Nov 13, 2008 6:48 am

Re: Execute A Program

Post by marksmithhfx » Thu Oct 23, 2025 10:51 pm

Hi Craig,

I'll give you a simple example (and obviously I want to do this on more complicated situations as well).

I create a new script-only stack. I put the following text into it...

script "OrganizeMain"
-- v1.0.0
-- Main stack for Organize iOS app
--
on preOpenStack
-- Initialize when stack opens
put "Organize starting..." into msg
end preOpenStack

And exactly at that point I want to test this, will it do what I have coded?

I know I can quit my application and re-launch from the Finder to find out what it does, but I think there is a clever way to just tell LC to run this script, but I can't remember what it is. And there is no "run" command in LC.

Suggestions?

Context: this is all in aid of "tooling" up to write Git-friendly script only stacks (or mostly script-only) so I can take advantage of Gits version control and also its project management and documentation features. And please don't call me crazy, I already know I am 🤪

PS thanks for the clarification on "start using" and "go" stack.

Best,
Mark
macOS 15.6 (Sequola), Xcode 15.3, LC 10.0.2, iOS 18.6.2

Post Reply