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
-
Klaus
- Posts: 14181
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Wed Apr 24, 2019 9:06 pm
hrcap wrote: ↑Wed Apr 24, 2019 8:59 pm
When the stack is built into a standalone application, is the resources folder protected?
No.
hrcap wrote: ↑Wed Apr 24, 2019 8:59 pm
i.e could the user potentially access the resources folder and modify a script only stack?
Yes.
-
RobertC
- VIP Livecode Opensource Backer

- Posts: 46
- Joined: Sun Feb 04, 2007 3:43 pm
Post
by RobertC » Thu Mar 19, 2020 10:10 pm
This is probably my ignorance, but when I try to use a script-only stack by
Code: Select all
start using stack "<path to file S>"
I get
Code: Select all
execution error at line … (Chunk: cant find stack), char 1
Is opening a stack from a file a feature that is not in the community or Indy edition?
I have Indy 9.5.1
Any thoughts?
The Old Rant Robert.
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Thu Mar 19, 2020 10:15 pm
Stack files are fundamental to LiveCode; using them is well supported in all editions.
Are you certain the path is correct?
Is the script-only stack in a valid format (with the stack declaration on the first line)?
-
kaveh1000
- Livecode Opensource Backer

- Posts: 539
- Joined: Sun Dec 18, 2011 7:23 pm
-
Contact:
Post
by kaveh1000 » Fri Mar 20, 2020 12:08 pm
I am successfully using multiple script only stacks read in by a main stack. My problem at the moment is encrypting the SOS's in standalone. This is something I still have to work out. If this is of interest to you, then please see this thread:
viewtopic.php?f=9&t=33678&e=1&view=unread#unread
where I have uploaded a minimal stack. I am trying to encrypt on the fly as I make the standalone.
If you don't need this then ignore.

Kaveh
-
RobertC
- VIP Livecode Opensource Backer

- Posts: 46
- Joined: Sun Feb 04, 2007 3:43 pm
Post
by RobertC » Fri Mar 20, 2020 4:58 pm
Richard asks if the path is correct and the content.
I'm not sure, but here is an archive (macOS) with the main stack and two files
The main stack's button has this script:
Code: Select all
on mouseup
if the optionkey is down then
FromPath
else
ExplicitFromFile
end if
putmilliseconds
end mouseup
on FromPath
start using stack "/Users/robertcailliau/Desktop/pms.livecodescript"
end FromPath
on ExplicitFromFile
create script only stack "pms"
open file "/Users/robertcailliau/Desktop/pms.livecodescript" for "utf-8" text read
read from file "/Users/robertcailliau/Desktop/pms.livecodescript" until EOF
set the script of stack "pms" to it
start using stack "pms"
end ExplicitFromFile
The ExplicitFromFile handler works fine, but the FromPath one gives the error.
Both text files contain the same thing:
Code: Select all
stack "pms"
on putmilliseconds
put the milliseconds into field 1
end putmilliseconds
There must be something I'm not getting…

The Old Rant Robert.
-
Thierry
- VIP Livecode Opensource Backer

- Posts: 875
- Joined: Wed Nov 22, 2006 3:42 pm
Post
by Thierry » Fri Mar 20, 2020 5:47 pm
First line of your text file, do:
That should work better....
Take care,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
-
RobertC
- VIP Livecode Opensource Backer

- Posts: 46
- Joined: Sun Feb 04, 2007 3:43 pm
Post
by RobertC » Sat Mar 21, 2020 3:47 pm
Yes Thierry, that does it… Thanks very much for spotting that.
Sorry for not having seen it! (I knew I'd done something terribly stupid).
Strangely though:
when reading it directly:
Code: Select all
start using stack "/Users/robertcailliau/Desktop/pms.txt"
the first line (script "pms") is removed from the loaded stack script, but when it's read explicity that line is not removed (in fact that's as expected) but it also does not give an error either.
Thanks everyone, have a nice locked-down day if you're in a locked-down situation (I am).
The Old Rant Robert.
-
bogs
- Posts: 5480
- Joined: Sat Feb 25, 2017 10:45 pm
Post
by bogs » Sat Mar 21, 2020 7:19 pm
Just wondering, Robert, whether or not you had come across this article, it seems to answer your observation:
https://livecode.com/script-only-stacks/ wrote:
In a nutshell, a script only stack is a text file, structured in a specific way, which the engine can load and save as if it were a normal stackfile. When the engine loads a script only stack, it creates a stack with the name specified in text file and sets the stacks script property to the script specified in the text file. When the engine saves a script only stack it reverses this process, writing out a text file containing the stack name and stack script and absolutely nothing else.
A little further down, you will see what Thierry mentioned...
The fact that script only stack files really are just text files is really important! It means you can edit and create them in any text editor you choose, and use any text based processing tool on them (the key thing for git is that you can diff and patch them)! The only thing to remember is that the very first line in the text file has to be of the form:
script "<name>"
With every line after the first being taken as the stack script.
Reporting from Lockdown New England,
bogs


-
trevix
- Posts: 1065
- Joined: Sat Feb 24, 2007 11:25 pm
-
Contact:
Post
by trevix » Mon Jul 21, 2025 7:05 pm
Hello.
I got my test version of the script only stack (see the attachment).
It works.
What I don't understand is why every time I try to save the "TestSOStack" stack or the "TestScript", be it in the project browser or directly in the stack, the Openstack of the TestScript starts running. It runs also when opening for the first time the inspector of the "TestScript" stack.
Is this a bug?
One more thing: I am not sure of how I arranged the opening order of things. I did my best, considering how little informations there is about it, but I may have done some confusion, in preopestack, openstack, in the card, in the stack, front, back, sideways...
Thanks for any help
-
Attachments
-
- Test_2.zip
- (2.5 KiB) Not downloaded yet
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7390
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Tue Jul 22, 2025 6:16 pm
When you save a stack, LC actually creates a new copy and deletes the old one. When the new one runs it's like you just opened it and all normal messages are sent. You can try locking messages before saving, or just type "save stack TestSOStack" in the message box.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com