saving all open stacks in standalone

Mark Swindell mdswindell at cruzio.com
Sun Apr 13 17:53:19 EDT 2008


On Apr 11, 2008, at 11:38 PM, Jan Schenkel wrote:
> --- Mark Swindell <mdswindell at cruzio.com> wrote:
>> I want to save all the stacks that are open in a
>> standalone.  These
>> are separate stack files, not substacks.  What
>> syntax needs to be
>> changed to make the following work?
>>
>>  if theKey is "Q" then
>>         put the stacks into saveUsAll
>>         repeat with x = 1 to the number of lines of
>> saveUsAll
>>             save stack (line x of saveUsAll)
>>         end repeat
>>         quit
>>     end if
>>
>>
>> Thanks,
>> Mark
>>
>
> Hi Mark,
>
> Assuming that all the stacks you want to save have
> some custom property set:
>
> ##
> put the openStacks into tOpenStacks
> repeat for each line tOpenStack in tOpenStacks
>  if the uSaveMePlease of stack tOpenStack then
>    save stack tOpenStack
>  end if
> end repeat
> ##

Thanks Jan,

Question:   Why would it matter if the stacks had custom property sets?

The openStacks was the function I needed... I'd tried to ask for a  
list of  "the open stacks" and had been turned away... I don't know  
why I didn't find it when I looked.  (One reason is that there is no  
reference to the openStacks function when you look at the Dictionary  
results for the Stacks function... see below)

Funny thing, both our scripts seem to work if I make the "Command-Q" a  
"Command-L," for example.    I moved the script into a shutDownRequest  
handler and it seems to be working.

Thanks for your help.

Mark


_____________________

Quick Search Results


Results From: Dictionary

stacks function the stacks ...

stackSpace function the stackSpace ...

stacksInUse property get the stacksInUse



For more information try one of the following options

  For a deeper Search try the Revolution Search Engine
  For other information on this topic try the User Guide

stacks

Type: function

Syntax: the stacks stacks()

See Also: defaultStack property, name property, openStacks function,  
reloadStack message, revLoadedStacks function, topStack function,  
visible property

Introduced: 1.0

Changed: 1.0

Platform Support:
Summary:
Returns a list of stack files that contain an open stack.

Examples:
the stacks


Use the stacks function to find out which stack files are open.

Value:
The stacks function returns a list of file paths of open stacks, one  
per line.

Comments:
Since unsaved stacks have no file name, the file names of unsaved  
stacks are not included in the list. Instead, each unsaved stack is  
represented by a blank line in the list.

The file paths of substacks are included, but the stack names  
themselves are not. This means that if more than one stack in a file  
is open, that file's path appears more than once in the list returned  
by the stacks function.

The list includes any open Revolution windows (such as the message box  
and menu bar). It also includes stacks that have been opened during  
the current session and then closed, unless the stack's destroyStack  
property is set to true.








More information about the use-livecode mailing list