Cant find contents of the SE

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 6:24 pm

I am at home, so not at my work computer. Another recent thread spoke about colorizing portions of text in the SE:
https://forums.livecode.com/viewtopic.php?f=9&t=37488
Fun stuff.

But I was playing around here, and discovered that nothing works for me, as usual.

I have a stack open with handlers in the SE. Works just fine. The SE itself is reported as being line 2 of "the stacks". I can verify that there is precisely one field in that stack (because there is only one tab open in the SE). But If I:

Code: Select all

answer fld 1 of stack line 2 of the stacks
I get empty. Field 1 in the SE is not, however empty.

I assume this is because I am new to LC, and to xTalks in general. :(

Craig
Last edited by dunbarx on Fri Nov 25, 2022 6:30 pm, edited 1 time in total.

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

Re: Cant find contents of the SE

Post by Klaus » Fri Nov 25, 2022 6:28 pm

Hi Craig,

does this work?

Code: Select all

...
answer fld 1 of stack (line 2 of the stacks)
## or
answer fld 1 of stack (line 2 of the openstacks)
...
Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 6:33 pm

Klaus.

Hi there. Are you new to LC as well?

I tried that right off, not believing that it would make any difference, and it does not.

I wonder if I would get the same answer at work.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 6:37 pm

And to make matter worse. I tried:

Code: Select all

set the backColor of line 3 to 6 of fld 1 of stack (line 2 of the stacks) to "yellow"
No error thrown, but nothing happens in the SE. Yet this is, essentially, a common tool I use all the time at work.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 6:39 pm

Perhaps because, even though there is indeed a field 1 in the SE, and even though I have working handlers there, yet since that field is empty, I cannot set the backColor of any of its non-existent text.

Craig

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Cant find contents of the SE

Post by bn » Fri Nov 25, 2022 6:42 pm

Craig,

I don't know what you are trying to do.

The topic you refer to deals with colorizing text in any field but _not_ in the Script Editor.

The active script editor is stack "revNewScriptEditor 1" if only one Script Editor is open.
The name of the field that holds the currently displayed script is "Script" (that holds for multiple tabs because the script editor just swaps scripts into that field to display the current tab)

Provided that the script editor was opened once and edits a script then

Code: Select all

answer fld "Script" of stack "revNewScriptEditor 1"
should display the script of the currently active tab or the script editor.

Kind regards
Bernd

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 6:44 pm

Klaus.

Lazy. Always a problem with me.

The "openStacks" works.

Why, though? I get everything properly returned by using "the Stacks".

Craig

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

Re: Cant find contents of the SE

Post by Klaus » Fri Nov 25, 2022 6:47 pm

dunbarx wrote:
Fri Nov 25, 2022 6:33 pm
Hi there. Are you new to LC as well?
Yep, just 23 years and still learning. :-)

Great the "the openstack" works, but no idea why...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 6:54 pm

Bernd.

When I first started fooling around with this, I simply typed in "revNewScriptEditor 1" because that is what I knew it to be at work. When that did not work I checked "the Stacks" I found that the name of the SE was "revNewScriptEditor.8".

Everything now seems to work, including, of course, using 'fld 1" as well as "fld script".

Probably me.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 7:03 pm

Bernd and Klaus.

OK. It is always me, but in my defense:

Currently, if I:

Code: Select all

answer line 3 of the openstacks
I get "revNewScriptEditor 1".
If I:

Code: Select all

answer line 3 of the stacks
I get a full pathName to "revNewScriptEditor.8"
If I:

Code: Select all

answer fld 1 of stack line 3 of the openstacks
I get the contents of the SE.
But if I:

Code: Select all

answer fld 1 of stack line 3 of the stacks
I get empty. There is a stack "revNewScriptEditor.8" somewhere.

Craig

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

Re: Cant find contents of the SE

Post by Klaus » Fri Nov 25, 2022 7:28 pm

I think LC clones a new script editor window "on the fly" from a stack.
So there is of course no filename for these.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Cant find contents of the SE

Post by bn » Fri Nov 25, 2022 7:59 pm

Craig,

I you use the Project Browser after choosing "Show IDE Stacks in Lists" from the "View" menu then you will find a stack

"revNewScriptEditor"

If you opened a Script Editor then you will find at least a subStack of revNewScriptEditor

"revNewScriptEditor 1"

These substacks "revNewScriptEditor x" are created on the fly when opening a script editor

Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Cant find contents of the SE

Post by richmond62 » Fri Nov 25, 2022 8:08 pm

"New to LC"

I can only assume . . .

Klaus has been 'at it' longer than I have, and have been 'at' LC for 21 years, and HC for 29 yeats.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cant find contents of the SE

Post by dunbarx » Fri Nov 25, 2022 8:32 pm

@Richmond.
I have been "at" HC for 35 years. With LC, 13.

All;
I understand how stacks can be created on the fly for certain purposes. But do not understand how I can ask for the current status of "the stacks", and get a result that includes, among several stacks that do indeed exist, a stack that nobody has ever heard about.

The "stacks" is "a list of all stack files that contain an open stack", whereas the "openStacks" contains "a list of the names of all open stacks.'"

Hmmm.

Sure, querying a property (the "text" of a field on that stack) might not yield anything except empty. At least it has a field. Well and good. But where did it come from? And who really cares?

Craig

Post Reply