Greasy Fork is available in English.

Dyskusje » Propozycje stworzenia skryptu/stylu

Generate filename image firefox dialogue open/save script

§
Napisano: 06-04-2016

Generate filename image firefox dialogue open/save script

Sorry my Google Translate English,

Please help me create javascript that would perform the functions specified in the title. It requires that it outputs the result of the functions listed below in the following form: "%originalfilename%_resultworkjavascript".

Еxample: Get greasyfork.org > right click logo image > Save Image As... > "SCN2YQGWLIU4_3u3tq6oc46f6u0yyfz.png" Extension may be not only ".PNG" . May be other image extensions.

Generator random expression:

 $(function() {
    function str_rand() {
        var result       = '';
        var words        = '0123456789qwertyuiopasdfghjklzxcvbnm';
        var max_position = words.length - 1;
            for( i = 0; i < 18; ++i ) {
                position = Math.floor ( Math.random() * max_position );
                result = result + words.substring(position, position + 1);
            }
        return result;
    }


    $("#run").click(function() {
    $("#resultwork").val(str_rand());
});
});

And what to do next, I do not know.

Odpowiedz

Zaloguj się, by odpowiedzieć.