The user guide has an example of determining the path of a file:
answer file "Choose a file"; put it
What about if I just want to know the path of the currently open stack? My stack (which will be the double-clickable) will call another stack to which the changes the user makes will be written. What code can I use in the script to open that stack if I don't know where the user will install my app and its support stacks?
Thanks!
Barry
Edit: All my stacks will be in the same folder.
Path question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 223
- Joined: Wed Jun 21, 2006 7:33 pm
- Contact:
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Path question
See the stack's filename property.
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
-
- Livecode Opensource Backer
- Posts: 366
- Joined: Tue Apr 10, 2012 9:18 am
Re: Path question
On one project I did something like this:
Code: Select all
global gDefaultFolder
/*********************************************************
stuff to do on open stack
**********************************************************/
on openStack
--set the gDefaultFolder to stack location
set the itemDelimiter to "/"
get the effective fileName of this stack
set the defaultFolder to item 1 to -2 of it
put the defaultFolder into gDefaultFolder
end openStack
-
- Posts: 223
- Joined: Wed Jun 21, 2006 7:33 pm
- Contact:
Re: Path question
Thank you for not smacking me upside the head.
Before I returned to this thread I did a search at the tutorials page for "path" and found the filename property. I've been away from Livecode for too long. I'm retiring in December and will finally start spending many more hours working with LC. If I keep working with it, I may remember more of this "little" code that is so essential.
Regards,
Barry

Before I returned to this thread I did a search at the tutorials page for "path" and found the filename property. I've been away from Livecode for too long. I'm retiring in December and will finally start spending many more hours working with LC. If I keep working with it, I may remember more of this "little" code that is so essential.
Regards,
Barry