Branch view, copy indents to clipboard?

Features wanted...
Post Reply
PlorerXY6
Posts: 43
Joined: 13 Oct 2022 19:51

Branch view, copy indents to clipboard?

Post by PlorerXY6 »

Is there any script or feature in branch view, to copy folder tab indents to clipboard?
Eg., then you can paste entire multiple directory structures into MS Word and apply multilevel numbering which is useful for an index.

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

Re: Branch view, copy indents to clipboard?

Post by admin »

This report feature does something similar:
Attachments
2023-11-13_092805.png
2023-11-13_092805.png (8.58 KiB) Viewed 295 times

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

Re: Branch view, copy indents to clipboard?

Post by highend »

You use what Don posted with the button "To Clipboard" and then execute this script afterwards:

Code: Select all

    $indention = "    "; // E.g. 4 spaces

    // Get only folders
    $result = formatlist(<clp>, "f", <crlf>, "*<DIR>*");

    // Remove unnecessary stuff
    $result = regexreplace($result, "; <DIR>;.+?(?=\r?\n|$)");

    // Replace indention
    $result = replace($result, ". ", $indention);

    // Remove leading "\ "
    $result = replace($result, "\ ");

    text $result;
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

PlorerXY6
Posts: 43
Joined: 13 Oct 2022 19:51

Re: Branch view, copy indents to clipboard?

Post by PlorerXY6 »

Thank you!

PlorerXY6
Posts: 43
Joined: 13 Oct 2022 19:51

Re: Branch view, copy indents to clipboard?

Post by PlorerXY6 »

Is there a way to strip the extra info (extension onwards) from subfiles as well & include tab indents from branch view? Think above script only handles directories.

EDIT: Must have been doing something weird, now it indents everything, but still want to get rid of this stuff:
1. in directories, the ending: -, <DIR>, 2023/12/14 10:15:01
2. file endings including extension: .pdf", 327,935, 2023/12/12 14:17:59
3. All quotation marks
4. Don't replace periods in the file name with spaces--only the periods before the file name start (before the quotations)

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

Re: Branch view, copy indents to clipboard?

Post by highend »

I've given you the basics to process the raw data. Now add the necessary regexes to get the output you need?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Post Reply