you have a standalone and a separate stack.
You want to open and later also SAVE that separate stack.
To do so, we need to copy that stack to a folder where we have write permission, which is specialfolderpath("documents")
Copying in LC goes via: put url("binfile:...") into url("binfile:"...)
URL means we target a FILE, either on the internet or on the users hard disk.
Please read up all unknown terms in the dictionary!
BINFILE means we are dealing with a BINARY file, in contrary to (text) FILE, which will only work for pure TEXT files like TXT, XML, HTML etc. But stacks are BINARY so we need to use BINFILE or we end with a corrupted stack!
And we do this in a IF THEN clause because we do not want to overwrite our copied stack with every launch of our app.
The script I posted has to go into the STANDALONE stack, that needs to do the copying if neccessary BEFORE opening the copied stack and THEN the standalone opens that stack in -> specialfolderpath("documents")
The script works definitively if used at the right time and location!

Please post your script(s) if in doubt.
Best
Klaus