Button script for "save as"

Sarah Reichelt sarahr at genesearch.com.au
Thu Aug 5 19:58:51 EDT 2004


> Sarah-The script worked great-Thanks! Would it be possible for you to 
> comment
> the script so I can understand what each command does? I'm a little 
> lost.
> Thanks for your help.
>
> jack

-- the next script line just asks for a file path to save to.
-- it can return a new file (not written yet) or an existing one
-- it returns empty if the user clicks Cancel
ask file "Save stack as:"
-- get the result of the "ask file" command and store it into the 
variable newName
put it into newName
-- if no file path was returned, get out of this routine
if newName is empty then exit to top

-- save the current stack file to the newly selected file path
-- if there is an existing file of that name, this will
-- ask if you want to replace it
save this stack as newName
-- "the fileName of this stack" gives you the complete file path
-- to the current stack file
put the fileName of this stack into tCheck
-- tell the user what the file path of the current stack file is, just 
to confirm
answer "Stack saved to file: " & tCheck

Cheers,
Sarah



More information about the use-livecode mailing list