Page 1 of 1
Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:24 pm
by dunbarx
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:28 pm
by Klaus
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:33 pm
by dunbarx
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:37 pm
by dunbarx
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:39 pm
by dunbarx
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:42 pm
by bn
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:44 pm
by dunbarx
Klaus.
Lazy. Always a problem with me.
The "openStacks" works.
Why, though? I get everything properly returned by using "the Stacks".
Craig
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:47 pm
by Klaus
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...
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 6:54 pm
by dunbarx
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 7:03 pm
by dunbarx
Bernd and Klaus.
OK. It is always me, but in my defense:
Currently, if I:
I get "revNewScriptEditor 1".
If I:
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 7:28 pm
by Klaus
I think LC clones a new script editor window "on the fly" from a stack.
So there is of course no filename for these.
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 7:59 pm
by bn
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
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 8:08 pm
by richmond62
"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.
Re: Cant find contents of the SE
Posted: Fri Nov 25, 2022 8:32 pm
by dunbarx
@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