Page 1 of 1

Print extension types

Posted: 03 Mar 2017 18:32
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.

Re: Print extension types

Posted: 03 Mar 2017 18:55
by bdeshi
check out the writefile() function.