Open a stack in the same folder

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 416
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Open a stack in the same folder

Post by maxs » Mon Jul 27, 2020 11:09 pm

Hi,

I can not get a stack in the same folder as my standalone to open. I get "Can't find file 'Spolin Workshop.livecode'." Any ideas?

Here is the script in my standalone:

on Openstack
put the effective filename of this stack into tPath
set itemdelimiter to "/"
delete last item of tPath
put "/" & "Spolin Workshop.livecode" after tpath

if there is a stack tpath
then
open stack tpath
else
answer "Can't find file 'Spolin Workshop.livecode'."
end if
end Openstack

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

Re: Open a stack in the same folder

Post by dunbarx » Tue Jul 28, 2020 3:56 am

Hi.

When you built your standalone, did you add the errant stack file in the "stacks" panel of the "Standalone Application Settings"?

Craig

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2530
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Open a stack in the same folder

Post by jmburnod » Tue Jul 28, 2020 8:15 am

Hi maxs,
Which platform do you use ?
I remember effective filename for OS X is diffferent than filepath for windows.
Best regards
Jean-Marc

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

Re: Open a stack in the same folder

Post by Klaus » Tue Jul 28, 2020 9:16 am

Hi Maxs,

add your stack(s and other files and folders) via the "Copy files" tab in the "Standalone Application Settings"!
The you will find it here -> specialfolderpath("resources") on ANY platform.

That specialfolderpath does also work in the IDE, it points to the folder the current stack is in!


Best

Klaus

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 416
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: Open a stack in the same folder

Post by maxs » Sat Aug 22, 2020 8:05 pm

Hi Klaus,

Thanks for replying.

I added my stack via the "Copy files" tab in the "Standalone Application Settings"! (But the stack would not allow me to make changes.)

I also added my stack under "Stack files in the application.

Both ways opened the stack, but all text added to fields was erased, and all changed were gone when I reopened the stack. I made the stack outside the standalone so I could save my changes. But that is not working.

I do not understand what this means, but I just need help saving my changes:
The you will find it here -> specialfolderpath("resources") on ANY platform.
That specialfolderpath does also work in the IDE, it points to the folder the current stack is in!

Any ideas? Max

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

Re: Open a stack in the same folder

Post by Klaus » Sat Aug 22, 2020 9:57 pm

Hi Max,

unless the user of your standalone has ADMIN privileges and the runtime has been installed
into the OS Application/Programm Files folder then we do not have write permissions there!
And saving a stack is considered writing in that folder.

So if you want to save the separate stacks then you need to copy them to the users preferences or
documents folder first just like on mobile.


Best

Klaus

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 416
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: Open a stack in the same folder

Post by maxs » Sat Aug 22, 2020 10:35 pm

Hi Klaus,

What a dunderhead I am. I forgot to tell you this is for a Mac. I know I should be able to save changes on a stack outside of a standalone. I did add "Save this stack" to a closestack, but the changes would not appear when I reopened.

Thanks for your help. I know Im missing something.
My best Max

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 416
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: Open a stack in the same folder

Post by maxs » Sun Aug 23, 2020 4:14 am

I may have an idea

When I added my stack via the "Copy files" tab , I believe it may have created an uneditable version of my stack. Perhaps I need to find a way to reference the pathname to the stack that is in the same location as the standalone, and then have it open that stack. Yes? If so, how?


Max

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 416
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: Open a stack in the same folder

Post by maxs » Tue Sep 01, 2020 8:55 pm

Hi Klaus,

I got it working. After a lot of fiddling. But your help was essential. Thank you for helping me through this important issue. Max

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”