Page 1 of 1

Syntax problem on "focus list"

Posted: 19 Jul 2022 01:04
by TedL1972
Whenever I run:

goto "Desktop|"; sortby m, d; sel 1; focus List;

I get the following error:

! Dubious syntax: List

I press continue and the script works normally but since I use this on other directories I would like to avoid the error msg every time.

Pls advise.

Re: Syntax problem on "focus list"

Posted: 19 Jul 2022 01:10
by klownboy
Try goto "Desktop|"; sortby m, d; sel 1; focus "L"; Refer to the "focus" scripting command in Help.

Re: Syntax problem on "focus list"

Posted: 19 Jul 2022 01:23
by TedL1972
Thanks! It worked.

I used the code from the Scripting codes in Help. So that was why I couldn't understand why the error. I do have the latest version of XY by the way.

Re: Syntax problem on "focus list"

Posted: 19 Jul 2022 08:28
by highend
I used the code from the Scripting codes in Help
You didn't. Hence the error.

Re: Syntax problem on "focus list"

Posted: 28 Jul 2022 19:41
by TedL1972
This is the script that is in my Help file:

Code: Select all

goto "Desktop|"; sortby m, d; sel 1; focus List;
It ends with

Code: Select all

focus List;
which caused the error.

So what am I missing?

Re: Syntax problem on "focus list"

Posted: 28 Jul 2022 20:37
by klownboy
TedL1972 wrote: 28 Jul 2022 19:41 This is the script that is in my Help file:
I'm not sure what "my help file" is, but in XYplorer's Help file it states: focus [control (L|A|T|C|P1|P2|PI|LFB)] Which means after "focus" you should specify one of those control letters (or letter number combinations), like "L", "A", etc. (not "List"). Even the example states:

Code: Select all

 focus or focus "L"
 Set focus to the List.
As stated "L" is the default, so a simple "focus" will also focus the "List". Go to Help on the menu bar and then click on "Help on Scripting Commands" and then find and click on "focus".

Re: Syntax problem on "focus list"

Posted: 29 Jul 2022 07:38
by TedL1972
Thanks for the data. Just to make it more clear where I got that code from.

It is from the Help menu of XY:

Contents and Index | Scripting |General Command Syntax | Examples

Then it gives two examples the second one is:

Code: Select all

goto "Desktop|"; sortby m, d; sel 1; focus List;

Re: Syntax problem on "focus list"

Posted: 29 Jul 2022 12:03
by klownboy
Okay thanks, that's an error in syntax for "focus".

Don in Help > Contents and Index | Scripting |General Command Syntax | Examples, the following is the second example. The syntax for focus is incorrect (e.g., dubious syntax error). It should be focus "L". Thanks.

Code: Select all

goto "Desktop|"; sortby m, d; sel 1; focus List;

Re: Syntax problem on "focus list"

Posted: 01 Aug 2022 12:41
by admin
Thanks.

focus "List"; works as well, but according to the docs it should be focus "L"; indeed.

Re: Syntax problem on "focus list"

Posted: 02 Aug 2022 17:07
by goldleiazale
I'm not sure what "my help file" is, but in XYplorer's Help file it states: focus [control (L|A|T|C|P1|P2|PI|LFB)] Which means after "focus" you should specify one of those control letters (or letter number combinations, Even the example states.

Re: Syntax problem on "focus list"

Posted: 02 Aug 2022 18:31
by admin
The wrong focus List; example is found in the current help file. It will not be there in the next one.

Re: Syntax problem on "focus list"

Posted: 02 Aug 2022 20:52
by klownboy
goldleiazale wrote: 02 Aug 2022 17:07 I'm not sure what "my help file" is, but in XYplorer's Help file it states: focus [control (L|A|T|C|P1|P2|PI|LFB)] Which means after "focus" you should specify one of those control letters (or letter number combinations, Even the example states.
Hi Don, was that some kind of fake post or bot that you just answered. I say that because that post is a duplicate of my post (i.e., the first paragraph) above here viewtopic.php?p=201180#p201180. :)

Re: Syntax problem on "focus list"

Posted: 02 Aug 2022 20:59
by admin
Oh, shit. Should have made the Turing test.