Saving standalone substacks
Kay C Lan
lan.kc.macmail at gmail.com
Wed Dec 16 23:28:06 EST 2009
On Thu, Dec 17, 2009 at 11:22 AM, J. Landman Gay
<jacque at hyperactivesw.com>wrote:
>
> Actually, I probably wasn't too clear. All that file path business was
> mostly for opening files, not for re-saving them. Once they're open from
> disk, the engine already knows the path, so "save this stack" is all you
> need.
>
> Is this true, the Dictionary says, under the save entry:
If you specify a name but not a location, Revolution assumes the file is in
the defaultFolder.
I've always worried, as I do tinker with the defaultFolder, that I might get
myself into a situation where the defaultFolder is not where I think it is
so I always specify the path when saving my app.
>
> You can get "the filename of this stack" to find out the path on disk
> without any parsing.
>
> Ah, I love this List. Another line of code eliminated.
> Anyway, this is what I use. It goes into the standalone's mainstack script:
>
> function appPath -- path to application folder
> put the effective filename of me into tPath
> set the itemdel to slash
> return (item 1 to -2 of tPath) & slash -- on OS X this is INSIDE the app
> bundle
> end appPath
>
> And then when I need to open a satellite stack:
>
> go stack (appPath() & "stack1.rev")
>
> Actually I see you use the 'effective filename' which I now appreciate
solves any file path issues regarding substacks.
Thanks.
More information about the use-livecode
mailing list