Syntax problem on "focus list"

Discuss and share scripts and script files...
Post Reply
TedL1972
Posts: 64
Joined: 15 Nov 2018 18:49

Syntax problem on "focus list"

Post 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.

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Syntax problem on "focus list"

Post by klownboy »

Try goto "Desktop|"; sortby m, d; sel 1; focus "L"; Refer to the "focus" scripting command in Help.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

TedL1972
Posts: 64
Joined: 15 Nov 2018 18:49

Re: Syntax problem on "focus list"

Post 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.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Syntax problem on "focus list"

Post by highend »

I used the code from the Scripting codes in Help
You didn't. Hence the error.
One of my scripts helped you out? Please donate via Paypal

TedL1972
Posts: 64
Joined: 15 Nov 2018 18:49

Re: Syntax problem on "focus list"

Post 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?

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Syntax problem on "focus list"

Post 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".
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

TedL1972
Posts: 64
Joined: 15 Nov 2018 18:49

Re: Syntax problem on "focus list"

Post 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;

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Syntax problem on "focus list"

Post 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;
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Syntax problem on "focus list"

Post by admin »

Thanks.

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

goldleiazale
Posts: 1
Joined: 02 Aug 2022 17:05

Re: Syntax problem on "focus list"

Post 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.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Syntax problem on "focus list"

Post by admin »

The wrong focus List; example is found in the current help file. It will not be there in the next one.

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Syntax problem on "focus list"

Post 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. :)
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Syntax problem on "focus list"

Post by admin »

Oh, shit. Should have made the Turing test.

Post Reply