#1
|
||||
|
||||
onmouseover description for custom toolbar buttons
Is it possible to add an 'onmouseover' 'description' for custom toolbar buttons that have been added and referenced from scripts?. I could not find any information in the global api or any options to add it from the menu customizer.
All JD2 default menu buttons have them. |
#2
|
|||
|
|||
Currently not possible. You can use custom icons to tell them apart or add them as sub-menu items in the main menu or toolbar.
|
#3
|
||||
|
||||
Thanks mgpai, I'm already using custom icons but i will add them as sub-menus to also have button 'name' associated with them.
|
#4
|
||||
|
||||
mgpai,
Is it possible to set interval trigger for a script that "exports" to a text file. I modified one of your scripts for package name exporting to a text file at different intervals but it is not triggering it. When I click 'test run' it exports the file with all the correct information to the proper location, however, the trigger does not seem to be working for it. I have tried different intervals from 3600000 to 21600000 but nothing works. Here is what I'm using: Code:
// Export linkgrabber package names // Trigger: Interval { var exportFolder = JD_HOME + "/auto/export/"; // <- Folder for exporting the text files var now = new Date().toString().substring(4, 24).replace(/:/g, "."); // <- Timestamp used in file name var exportFile = now + " - package names.txt"; // <- Filename for exporting the URLs var myWavFile = JD_HOME + "/themes/standard/org/jdownloader/sounds/captcha.wav"; // path to 'wav' file var urls = []; getAllCrawledPackages().forEach(function(link) { var fileName = link.getName(); urls.push(fileName); }) if (urls.length) { if (!getPath(exportFolder).exists()) getPath(exportFolder).mkdirs(); writeFile(exportFolder + exportFile, urls.join("\r\n"), true); //playWavAudio(myWavFile); // Uncomment this line to play sound file after file is created } } Last edited by RPNet-user; 05.03.2020 at 01:31. |
#5
|
|||
|
|||
Quote:
How often do you want to export it? |
#6
|
||||
|
||||
Quote:
Well it can't be the 'ms' cause my 1st interval script is working fine at every 8-hours, but script-2 and script-3 are also set for 8-hours but no exporting, sync is disabled for all three scripts, anyway, all three scripts are set for 8hrs(28800000) and i just restarted JD, i will check them later. I decided to set script-1 interval at(28800000) script-2 interval at (28920000) and script-3 at (28980000) two minutes apart from each other since I need scripts-2/3 to run after the 1st script completes. Ok so i decided to consolidate scripts-2/3 by merging them into one so now they export two txt files simultaneously. I tested it at one minute intervals then set it for 8-hrs-2min(28920000) to give the first script 2-min to complete. I restarted JD to reset timers for both intervals. The 1st one ran 2hrs.20min before it should have and the 2nd one ran about 10min before it should have. Last edited by RPNet-user; 06.03.2020 at 05:26. |
#7
|
||||
|
||||
{
} mgpai, is it possible to set an x amount of time between executing above script and bottom script? { } I currently have scripts-2/3 merged into a single script and I'm trying to merge scripts-2/3 with script-1, however, I need scripts-2/3 to wait two minutes to execute after script-1. These JD trigger intervals do not function properly when they are set for long amount of hours. Sometimes they work on schedule(somewhat) and sometimes they do not. I set the two scripts to run after 8 eight hours, yet they execute 1hr.42minutes later or whenever they want. Yes I clicked saved, completely exited JD, waited a couple minutes to re-start JD in order to reset counter/timer, yet it fails to run after the specified amount of time, and yes JD stays on 24x7. I have monitored up to 3 hours for different interval-tasks and they execute properly every time and on-time, however longer hours are intermittent and unreliable. Last edited by RPNet-user; 06.03.2020 at 14:23. |
#8
|
|||
|
|||
Quote:
Code:
// sleep(myInt/*milliseconds*/);/*Perform a sleep and wait for x milliseconds*/ alert("first message"); // Execute this code ... sleep(1 * 60 * 1000); // ... wait for 1 minute ... alert("second message"); // .. then execute this code |
#9
|
|||
|
|||
Quote:
Code:
// Run script at user-specified time // Trigger: Interval // Set interval to 1000 ms var schedule = []; var addSchedule = function(hours, minutes) { schedule[schedule.length] = new Date().setHours(hours, minutes, 0, 0); } // Syntax: addSchedule(hours,minutes); addSchedule(00, 00); addSchedule(08, 00); addSchedule(16, 00); var currentTime = new Date().setMilliseconds(0); if (schedule.indexOf(currentTime) > -1) { // Script content goes here } |
#10
|
||||
|
||||
Thanks mgpai,
I just tested both and they work perfectly. I tested the sleep-script first with the 3-merged scripts and it ran perfectly, then I added your 2nd script to run at the specified time which also ran perfectly. By the way, this is great that I can add the schedule,... easier and more manageable than just randomly set interval triggers. Last edited by RPNet-user; 06.03.2020 at 16:09. |
Thread Tools | |
Display Modes | |
|
|