Print extension types

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
forgottenit
Posts: 10
Joined: 23 Jan 2016 20:40

Print extension types

Post by forgottenit »

The following script displays the extensions for all file categories in the dialogue box.

How do I get it to send the extension to a new text file?

Code: Select all

    $fileTypes = "{:Archive}|{:Audio}|{:Executable}|{:Font}|{:Image}|{:Media}|{:Office}|{:Photo}|{:Text}|{:Vector}|{:Video}|{:Web}";
    $maxStrLen = 15; // "{:Executable}"

    $content = "";
    foreach($entry, $fileTypes) {
        $entries = recase(formatlist(regexreplace(get("genericfiletype", $entry, ","), "\*\."), "s", ","), "l");
        $content = $content . $entry . strrepeat(" ", $maxStrLen - strlen(quote($entry))) . ": " . $entries . <crlf>;
    }
    text $content;
I want to do this so I can build a list of file types to exclude from a search.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Print extension types

Post by bdeshi »

check out the writefile() function.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply