Saving as LiveCodeScript

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9403
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Saving as LiveCodeScript

Post by richmond62 » Sun Apr 21, 2024 9:46 am

saveAS.png
-
While I understand it is comparatively straightforward to write a script-only stack in a text editor . . .

. . . I wonder if there is a way to convert a stack into a script-only stack.

It is entirely possible, also, to edit a script-only stack using a text editor (I know, I have done that):

but one of the difficulties about that is if one wants the script-only stack to generate a full stack that is visible to end-users with graphic elements.

Klaus
Posts: 13832
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Saving as LiveCodeScript

Post by Klaus » Sun Apr 21, 2024 11:04 am

In LC 9.6.11 (and probably in versions below) we have a menuitem for that.
Bildschirmfoto 2024-04-21 um 12.00.34.png
However a "script-only" stack is exactly what the name says, so this:
but one of the difficulties about that is if one wants the script-only stack to generate a full stack that is visible to end-users with graphic elements.
is not possible with a "script-only" stack.
Get it? SCRIPT ONLY! :D :D :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9403
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Saving as LiveCodeScript

Post by richmond62 » Sun Apr 21, 2024 11:37 am

is not possible with a "script-only" stack.
The menuBar.livecodescript script-only stack generates the LC menuBar.

Klaus
Posts: 13832
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Saving as LiveCodeScript

Post by Klaus » Sun Apr 21, 2024 12:02 pm

Yes, sorry, looks like I misunderstood your question.

Well, a script-only stack can of course create another stack with lots of controls, if that is what you mean.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9403
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Saving as LiveCodeScript

Post by richmond62 » Sun Apr 21, 2024 1:07 pm

That is part of what I meant.

But, just as a script-only stack can create another stack with lots of controls, I want to know if one can reverse the process where a "stack with lots of controls" can be saved as a script-only stack in such a fashion that on that script-only stack being opened inwith the IDE it can re-create that "stack with lots of controls".

Klaus
Posts: 13832
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Saving as LiveCodeScript

Post by Klaus » Sun Apr 21, 2024 1:13 pm

I don't think this is possible this way.
The only way seem to save the actual stack script as a script-only stack

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Saving as LiveCodeScript

Post by dunbarx » Sun Apr 21, 2024 1:32 pm

Richmond.

How could a stack that contains even a single control ever be reduced to a script-only stack? What would we do with that control?

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9678
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Saving as LiveCodeScript

Post by dunbarx » Sun Apr 21, 2024 1:36 pm

I am not sure that even a control-less stack can be "reduced" to being script-only. Such a stack has properties, for example its rect, that a script only stack does not, and aren't there conservation laws such as:
"rects can neither be created not destroyed"?
Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Saving as LiveCodeScript

Post by FourthWorld » Sun Apr 21, 2024 4:14 pm

richmond62 wrote:
Sun Apr 21, 2024 1:07 pm
That is part of what I meant.

But, just as a script-only stack can create another stack with lots of controls, I want to know if one can reverse the process where a "stack with lots of controls" can be saved as a script-only stack in such a fashion that on that script-only stack being opened inwith the IDE it can re-create that "stack with lots of controls".
What benefit are you looking for with that? We can come up with a solution once we know the goal.
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: 9403
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Saving as LiveCodeScript

Post by richmond62 » Sun Apr 21, 2024 6:25 pm

Many years ago I wrote a stack to modify the revMenBar stack on the fly to make it horizontal, vertical, black, blue and sky-blue-pink.

The revMenuBar is generated from a script-only stack: I should like to have a way where end-users of the LC IDE can modify the appearance of the revMenuBar so that those modifications will stick between LC sessions.
Last edited by richmond62 on Sun Apr 21, 2024 7:33 pm, edited 1 time in total.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7241
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Saving as LiveCodeScript

Post by jacque » Sun Apr 21, 2024 6:50 pm

richmond62 wrote:
Sun Apr 21, 2024 1:07 pm
But, just as a script-only stack can create another stack with lots of controls, I want to know if one can reverse the process where a "stack with lots of controls" can be saved as a script-only stack in such a fashion that on that script-only stack being opened inwith the IDE it can re-create that "stack with lots of controls".
I'm not sure why you want a script-only stack instead of a regular one. Script-only stacks are just text files. However you could probably script the creation of controls when the stack loads but that seems like way more work than just using a normal stack.

Why are you thinking a script-only stack is preferable?

Edit: I see you answered while I was writing a response.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Saving as LiveCodeScript

Post by FourthWorld » Sun Apr 21, 2024 8:40 pm

richmond62 wrote:
Sun Apr 21, 2024 6:25 pm
Many years ago I wrote a stack to modify the revMenBar stack on the fly to make it horizontal, vertical, black, blue and sky-blue-pink.

The revMenuBar is generated from a script-only stack: I should like to have a way where end-users of the LC IDE can modify the appearance of the revMenuBar so that those modifications will stick between LC sessions.
Modify the revMenubar file directly. But upgrades will overwrite your changes. Modifying IDE stuff is an ongoing treadmill.

Simpler to do as suggested in these forums years ago: write a plug-in that makes the mods to the revMenubar stack after it's been instantiated.
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: 9403
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Saving as LiveCodeScript

Post by richmond62 » Sun Apr 21, 2024 9:00 pm

that makes the mods to the revMenubar stack after it's been instantiated
That is exactly what I am trying to avoid,

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Saving as LiveCodeScript

Post by FourthWorld » Sun Apr 21, 2024 9:35 pm

richmond62 wrote:
Sun Apr 21, 2024 9:00 pm
that makes the mods to the revMenubar stack after it's been instantiated
That is exactly what I am trying to avoid,
Why?
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: 9403
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Saving as LiveCodeScript

Post by richmond62 » Mon Apr 22, 2024 6:06 am

Portativity.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”