Finding out a list of open stacks

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Finding out a list of open stacks

Post by andrewferguson » Wed Jul 03, 2013 2:48 pm

Hi everyone,
I am looking for a way to find out a list of all the current stacks that are open that are not LiveCode IDE stacks or plugins.
Thanks,
Andrew

Klaus
Posts: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Finding out a list of open stacks

Post by Klaus » Wed Jul 03, 2013 3:12 pm

Hi Andrew,

your subject lines almost had it :-)
...
## Well, simple and Livecode-like :-D
put the openstacks into tStackList

## Get rid of revXXX stacks:
filter tStacklist without "rev*"
answer tStackList
...
:-)


Best

Klaus

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Finding out a list of open stacks

Post by andrewferguson » Wed Jul 03, 2013 3:18 pm

Hi Klaus,
Thanks! However I need to also filter stacks like the message box which do not have "rev" in their name.
Thanks,
Andrew

Klaus
Posts: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Finding out a list of open stacks

Post by Klaus » Wed Jul 03, 2013 3:31 pm

OK:
...
filter tStacklist without "rev*"
filter tStackList without "Message Box"
...
That's it :-D
No other Rev stacks without the REV prefix.

Hint:
Since plugins can be named anything, you may be out of luck to differ these from other stacks.
Maybe check front- and backscripts, too, but in general this is not trivial.

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Finding out a list of open stacks

Post by shaosean » Wed Jul 03, 2013 3:44 pm

You can also take a look at the revLoadedStacks function..

Klaus
Posts: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Finding out a list of open stacks

Post by Klaus » Wed Jul 03, 2013 4:32 pm

Ah, yes, did not know about these params to that function:
...
Parameters
xmlerr, can't find element - xmlerr, can't find element
xmlerr, can't find element - xmlerr, can't find element
xmlerr, can't find element - xmlerr, can't find element
xmlerr, can't find element - xmlerr, can't find element
...
:-D

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Finding out a list of open stacks

Post by andrewferguson » Wed Jul 03, 2013 5:43 pm

Hi,
Thanks! That works.
Andrew

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Finding out a list of open stacks

Post by shaosean » Thu Jul 04, 2013 6:28 am

I believe the different parameters are:
revLoadedStacks() -- shows all except the rev stacks
revLoadedStacks("all") -- shows them all
revLoadedStacks("preferences") -- shows stacks based on preferences settings (show/hide rev stacks)

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Finding out a list of open stacks

Post by andrewferguson » Thu Jul 04, 2013 12:48 pm

shaosean wrote:revLoadedStacks() -- shows all except the rev stacks
Thanks! That would work too.
Andrew

Post Reply