^ Flat View Sample?

Discuss and share scripts and script files...
Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

^ Flat View Sample?

Post by Zardoz2293 »

Would appreciate a sample script call using the "Flat View" mode. I'm currently using "folderreport" and I'm sure I'm on the wrong track.
:roll:
Thanks!
Last edited by Zardoz2293 on 12 Feb 2012 21:44, edited 1 time in total.
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

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

Re: Flat View Sample?

Post by admin »

If you want to turn on Flat View via scripting:

Code: Select all

goto "? /:flat";

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Flat View Sample?

Post by TheQwerty »

You can also dial:

Code: Select all

#311; //View | Tab | Views | Flat View

Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

Re: Flat View Sample?

Post by Zardoz2293 »

Sorry gentlemen, I'm just not getting it. I've reviewed the scripting stuff, but I just don't see how to get a BV (Branch View) into a variable. I don't want any of my visual / displayed tabs views / trees / lists to be modified. When I saw some of the output Don showed with the BV and the sorting capability I knew that was what I needed. I want to utilize native XY capability over doing manual coding to achieve the desired effect.

Currently, I have something like (example is overly simplified):

Code: Select all

//<curpath> == "F:\XY.Test\Test\PDF\v3"

$FileList = folderreport("items", "r", "<curpath>", "r", , "|");
Which returns (totally useless to me):

Code: Select all

F:\XY.Test\Test\PDF\v3                                         <DIR>
F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)                      <DIR>
F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)\Install.exe
F:\XY.Test\Test\PDF\v3\v3.20 (2005-11-05)                      <DIR>
F:\XY.Test\Test\PDF\v3\v3.20 (2005-11-05)\Install.exe
F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)                      <DIR>
F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)\Install.exe
as it needs to be like the result set below:

Code: Select all

F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)\Install.exe
F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)                       <DIR>
F:\XY.Test\Test\PDF\v3\v3.20 (2005-11-05)\Install.exe
F:\XY.Test\Test\PDF\v3\v3.20 (2005-11-05)                       <DIR>
F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)\Install.exe
F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)                       <DIR>
F:\XY.Test\Test\PDF\v3                                          <DIR>
I don't find or I'm not recognizing the information within the online help file. Under "Scripting Command Reference", 'branch' is only referenced under "box".

Does getting a BV into a variable take more than a single like of code? Is there an example of this?

I'm totally lost. Thanks for the feedback.
Last edited by Zardoz2293 on 30 Jan 2012 22:16, edited 1 time in total.
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

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

Re: Flat View Sample?

Post by admin »

This will give you the idea:

Code: Select all

goto "E:\Test\a\? /:flat";

Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

Re: Flat View Sample?

Post by Zardoz2293 »

admin wrote:This will give you the idea:

Code: Select all

goto "E:\Test\a\? /:flat";
I'm getting some odd effects, but I'll discuss that later.

Is there any native scripting method to "Order By FILES, FOLDERS" rather than the default "Order By FOLDERS, FILES"?
Zardoz2293 wrote:Default: Order By FOLDERS, FILE

Code: Select all

F:\XY.Test\Test\PDF\v3                                      <DIR>
F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)                   <DIR>
F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)\Install.exe
Required/Needed: Order By FILES, FOLDERS

Code: Select all

F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)\Install.exe
F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)                   <DIR>
F:\XY.Test\Test\PDF\v3                                      <DIR>
Thanks!
Last edited by Zardoz2293 on 31 Jan 2012 01:28, edited 3 times in total.
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Flat View Sample?

Post by serendipity »

Zardoz2293 wrote:
admin wrote:This will give you the idea:

Code: Select all

goto "E:\Test\a\? /:flat";
I'm getting some odd effects, but I'll discuss that later.

Is there any native scripting method to "Order By FILES, FOLDERS" rather than the default "Order By FOLDERS, FILES"?
Zardoz2293 wrote:Default:

Code: Select all

F:\XY.Test\Test\PDF\v3
F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)
F:\XY.Test\Test\PDF\v3\v3.10 (2005-10-03)\Install.exe
Required:

Code: Select all

F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)\Install.exe
F:\XY.Test\Test\PDF\v3\v3.64 (2010-12-10)
F:\XY.Test\Test\PDF\v3
Thanks!
Closest you can get is:
Config>General>Sorting> and uncheck Keep folders on top. Then sort descending.

Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

Re: Flat View Sample?

Post by Zardoz2293 »

serendipity wrote:Closest you can get is:
Config>General>Sorting> and uncheck Keep folders on top. Then sort descending.
So it can't be done in scripting?
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Flat View Sample?

Post by serendipity »

Zardoz2293 wrote:
serendipity wrote:Closest you can get is:
Config>General>Sorting> and uncheck Keep folders on top. Then sort descending.
So it can't be done in scripting?
AFAIK, no.

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: Flat View Sample?

Post by nas8e9 »

@Zardoz2293: Don was asking for command ID's to be added today, in this thread.

Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

Re: Flat View Sample?

Post by Zardoz2293 »

serendipity wrote:Config>General>Sorting> and uncheck Keep folders on top. Then sort descending.
My comment here is not related to this topic, but thanks for the location of the "Keep folders on top" information -- I've been looking for it but wasn't sure of the name or where to find. Thanks! :D
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

Re: Flat View Sample?

Post by Zardoz2293 »

serendipity wrote:Closest you can get is:
Config>General>Sorting> and uncheck Keep folders on top. Then sort descending.
AFAIK the above has no effect on the order of the folders and files in a Branch View.
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

Re: Flat View Sample?

Post by Zardoz2293 »

nas8e9 wrote:@Zardoz2293: Don was asking for command ID's to be added today, in this thread.
I haven't got the hang of the whole command ID thing, so I don't understand the impact of what this means.
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: Flat View Sample?

Post by nas8e9 »

Zardoz2293 wrote:
nas8e9 wrote:@Zardoz2293: Don was asking for command ID's to be added today, in this thread.
I haven't got the hang of the whole command ID thing, so I don't understand the impact of what this means.
From the help file:
Scripting by Numbers

In XYplorer almost every function has a fixed number, the function ID, by which it can be referred to in a script. ID #1026 happens to refer to "Miscellaneous / Find Files / Open Find Files and Reset". Open the Customize Keyboard Shortcuts dialog (menu Tools) and find this function in category Miscellaneous. At the bottom of the dialog you'll see a button showing the function's ID. Clicking this button will copy the function's ID to the clipboard, making it easy to use it in a script.

You can execute almost any function in XY in a script by referring to its function ID. E.g. #230 will pop up the submenu "New" of menu Edit.
However, I was barking up the wrong tree: XYplorer's scripting has a setting command:
setting

Alter some of XYplorer's user settings, temporarily or permanently. Typically used in order to ensure the expected execution of a script, which might depend on certain settings.

Syntax

setting name, [value (1|0|r)], [permanent (p)]

name

[Required] One of the following (case insensitive):

...

SortFoldersApart: Sort folders apart
... meaning adding the following to your script:

Code: Select all

setting SortFoldersApart, 0;
...should work?

Zardoz2293
Posts: 594
Joined: 09 Nov 2011 20:20
Location: USA

Re: Flat View Sample?

Post by Zardoz2293 »

I'm not have success with the:

Code: Select all

setting SortFoldersApart, 0;
However, the problem is, I need all the files processed in each folder before the folder containing those files are renamed. The current order of the files/folders works only if you approach processing from the end -->start of the result set. However, the foreach only processes from from the start-->end. Using a "while" is not as elegant and risk free as a foreach. I don't see that PHP reverse array elements and I don't want to perform a scripted reverse of the string array to be able to use the foreach. Therefore the inferior while will have to be used, unless there is a superior alternative I'm not aware of.

What are your thoughts?
:off:MacOS Tahoe v26.1 | Windows 11 Pro v25H2.26200.7309 >> Scaling VMs: 2056x1285 @100%; 4112x2658 @400%

Post Reply