App with documents
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: App with documents
Is the file being saved a user document file, or something that your program uses internally? If the former guess you can always prepend something to the stack name when it's loaded and then remove it when the stack is being saved.. If the latter are you saving it to the Application Support folder so the end user can't easily modify it?
Re: App with documents
Hi shaosean, thank you for your post. The file is saved in the location the user choose to save it, and the user has full access to the file in the Finder. Like a doc of Pages or Word.shaosean wrote:Is the file being saved a user document file, or something that your program uses internally? If the former guess you can always prepend something to the stack name when it's loaded and then remove it when the stack is being saved.. If the latter are you saving it to the Application Support folder so the end user can't easily modify it?
Re: App with documents
I just created a stack and called it "turkey" from within the IDE.. I saved it to my Documents folder, quit LiveCode and then renamed the stack file to "1".. Reopened the stack in LiveCode and it's still called "turkey" in the IDE.. The filename property and the name property of the stack can be two different things.. So you could always prepend a string to the stack name to ensure that there is never a number as the first character..
I didn't have much luck with this actually saving in the IDE, but the name of the stack did get changed and I am sure that there is something with the IDE tools (it works when I suspend the development tools, so should work in a compiled application as well)
Code: Select all
on saveStackRequest
if (char 1 to 4 of the short name of this stack <> "moo_") then
local tStackName
put the short name of this stack into tStackName
put "moo_" before tStackName
set the name of this stack to tStackName
end if
pass saveStackRequest
end saveStackRequest
Re: App with documents
A little more work will be needed to handle the first time save using a number, but the idea is there..
Re: App with documents
Hi shaosean, really interesting info. I will do some tests.