View Single Post
  #1232  
Old 14.03.2020, 04:46
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default

Quote:
@BJN01
...notepad open with the info pasted inside...
autoit cmd to pass var to notepad.exe
hxxps://workupload.com/file/dd5yQzu2
pwd: bjn01

Code:
// "select link, paste them in a tx and open it"
// N.B = add button (event scrip trigger) in linkgrabber contextmenu
// Trigger : linkgrabber contextmenu button press

//--------------------------------------------------------------------------------------------------------------
//IMPORTANT: Create sub-folder '_bin' in JD_HOME then download and copy 'notepadCmd.exe' to dir
//--------------------------------------------------------------------------------------------------------------


//--------------------------------------------------------
disablePermissionChecks(); //no prompting persmision dialog
//enablePermissionChecks(); //required prompting permision


//--------------------------------------------------------
if (name == "Save LinkGrabber selez + open txt") {

    var dateTime = _dateTime();
    var exePath = JD_HOME + '\\_bin';
    var exeCmd = 'notepadCmd.exe'
    var textEditor = getPath(exePath + "\" + exeCmd);
    var namesAndUrls = [];

    if (!textEditor.exists()) {
        alert("EXE FILE NOT FOUND!\r\n" + "Create subfolder '_bin' and copy '" + exeCmd + "' to:\r\n\r\n" + exePath);
    } else {

        //select 1 or multiple files
        var selections = lgSelection.getLinks();
        for (i = 0; i < selections.length; i++) {
            var selection = selections[i];
            var fileName = selection.getName();
            var url = selection.getContentURL();
            //nameAndUrl.push(fileName + " , " + url);
            namesAndUrls.push('Name: ' + fileName + "\r\n" + 'Link: ' + url + "\r\n");
        }

        var selectedFiles = namesAndUrls.join('\r\n', true);
        var finalText = dateTime + '\r\n' +
            '-------------------------' + '\r\n' +
            selectedFiles;

        if (selections.length) {
            callSync(textEditor, '-notepad', finalText);
        }
    }
}

//--------------------------------------------------------
//---retrieve current date time---
function _dateTime() {
    var date = new Date();
    var dateTime = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toJSON(); //yyyy-mm-ssThh:mm:ss.msZ
    var finalDateTime = dateTime.substr(0, 23).replace("T", "_-_").replace(/:/g, ".");
    return finalDateTime
}


Quote:
In JD there is a command: <<clear filtered links>>
( setting\user interface\linkgrabber botton bar .....
the icon is a gray funnel)
I matched it with a shost cut (ctrl + del)

so when I have the JD window open I activate it by pressing the two keys (ctrl + del).

autoit send Ctrl+Del
hxxps://workupload.com/file/y68E8GBS
pwd: bjn01

Code:
function hotkeyCtrlDel()
    var exePath = JD_HOME + '\\_bin';
    var exeCmd = 'jdHotkey.exe'
    var hotkey = getPath(exePath + "\\" + exeCmd);
    callSync(hotkey, '-hkey');
}

Last edited by zreenmkr; 14.03.2020 at 06:16. Reason: autoit file updated
Reply With Quote