Execute A Program
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Execute A Program
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.
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

- Posts: 10204
- Joined: Fri Feb 19, 2010 10:17 am
Re: Execute A Program
I tend to run programs by double-clicking symbolic links on the desktop.
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10065
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Execute A Program
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
richmond62
- Livecode Opensource Backer

- Posts: 10204
- Joined: Fri Feb 19, 2010 10:17 am
Re: Execute A Program
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

- Posts: 10065
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Execute A Program
This being a LiveCode forum, that's how I inferred the question.richmond62 wrote: ↑Sat Sep 26, 2020 9:06 am"How can I launch a Windows program from inwith LiveCode without using a shell command."
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
richmond62
- Livecode Opensource Backer

- Posts: 10204
- Joined: Fri Feb 19, 2010 10:17 am
Re: Execute A Program
Well, you are obviously privy to some information which I am not.This being a LiveCode forum, that's how I inferred the question.
Given the number of totally out-of-context spam messages that keep turning up hereabouts, I . . .
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10065
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Execute A Program
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
richmond62
- Livecode Opensource Backer

- Posts: 10204
- Joined: Fri Feb 19, 2010 10:17 am
Re: Execute A Program
Thanks: I'll remember that in future.When in doubt look at a user"s profile.
-
marco.deepak
- Posts: 11
- Joined: Fri Oct 02, 2020 10:24 am
Re: Execute A Program
In my windows application I run a batch file by pressing a button.
I use the following code:
Maybe it works also with exe files?.
Hope it helps
M.
I use the following code:
Code: Select all
on mouseUp
answer"prompt text"with"closing button text"
launch document "complete Path"
end mouseUpHope it helps
M.
Re: Execute A Program
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!
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

- Posts: 939
- Joined: Thu Nov 13, 2008 6:48 am
Re: Execute A Program
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
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

- Posts: 939
- Joined: Thu Nov 13, 2008 6:48 am
Re: Execute A Program
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
Thanks
macOS 15.6 (Sequola), Xcode 15.3, LC 10.0.2, iOS 18.6.2
Re: Execute A Program
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" 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
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:
Threw me.start using stack "stack name" or go stack "stackName" ...
"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

- Posts: 939
- Joined: Thu Nov 13, 2008 6:48 am
Re: Execute A Program
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
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