Page 1 of 2

^ Flat View Sample?

Posted: 01 Dec 2011 02:39
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!

Re: Flat View Sample?

Posted: 01 Dec 2011 10:22
by admin
If you want to turn on Flat View via scripting:

Code: Select all

goto "? /:flat";

Re: Flat View Sample?

Posted: 01 Dec 2011 12:21
by TheQwerty
You can also dial:

Code: Select all

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

Re: Flat View Sample?

Posted: 27 Jan 2012 21:59
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.

Re: Flat View Sample?

Posted: 28 Jan 2012 10:01
by admin
This will give you the idea:

Code: Select all

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

Re: Flat View Sample?

Posted: 30 Jan 2012 21:43
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!

Re: Flat View Sample?

Posted: 30 Jan 2012 22:11
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.

Re: Flat View Sample?

Posted: 30 Jan 2012 22:14
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?

Re: Flat View Sample?

Posted: 30 Jan 2012 22:31
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.

Re: Flat View Sample?

Posted: 31 Jan 2012 00:18
by nas8e9
@Zardoz2293: Don was asking for command ID's to be added today, in this thread.

Re: Flat View Sample?

Posted: 31 Jan 2012 01:02
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

Re: Flat View Sample?

Posted: 31 Jan 2012 01:08
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.

Re: Flat View Sample?

Posted: 31 Jan 2012 01:09
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.

Re: Flat View Sample?

Posted: 31 Jan 2012 01:18
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?

Re: Flat View Sample?

Posted: 31 Jan 2012 01:41
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?