There are a many times where I have a folder with many various files and folders in them. I then want to organize it and going through each individual items, I would then either copy or move them to their organized folders such as:
E:\Desktop\Pictures\Japan
E:\Dekstop\Pictures\Switzerland
O:\Some\Other\Folder\Path
As such, there is a feature in another software that allows me to redo certain operations. It does it by tracking what operation I did (copy/move) and the destination. Therefore if I had previously moved files into the three example folders above, the feature would give me a popout list that allows me to select what recent operation to do and apply them to my currently selected files or folders regardless if they're not the same files or folders I had operated on previously into those folders.
I'm now trying to implement this by scripting it here in DOpus so that I can have this wonderful feature in both software. However I'm new to scripting here and I'm really confuse and stuck how to proceed with this. This is my current work so far:
// Redo Operation
// (c) 2017 Enternal
// Called by Directory Opus to initialize the script
function OnInit(initData)
{
initData.name = "Redo Operation";
initData.version = "0.0.1";
initData.copyright = "(c) 2017 Enternal";
//initData.url = "https://resource.dopus.com/";
initData.desc = "Track copy/move operations and allow redo for other selected items";
initData.default_enable = true;
initData.min_version = "12.0";
}
// Called when a copy or move operation take place
function OnGetCopyQueueName(GetCopyQueueNameData)
{
var reops_dest = GetCopyQueueNameData.dest;
var reops_move = GetCopyQueueNameData.move;
var reops_redo;
DOpus.vars.Set("reops_redo", [[reops_move, reops_dest], [reops_redo]]);
//DOpus.vars.Set("reops_redo").persist = false; //persist across session only instead of reboot?
//https://resource.dopus.com/t/question-about-jscript-based-rename-script-syntax/10562/1
//var Shell = new ActiveXObject("WScript.Shell");
//Shell.Popup(reops_dest, 0, "Destination Path", 0x30);
//DOpus.Output(reops_redo);
//DOpus.Output(reops_redo[0]);
//DOpus.Output(reops_redo[1]);
}
What I'm trying to do is have it automatically track (whenever there is a copy or move operation) and store whether it's a copy or a move operation and the destination into a DOpus global multidimensional array. Basically it will be a nx2 array. I will then use an additional button script that will then use that data to make a list of the recent operations while listing the most recent operation at the top by divided into groups whether it's a copy or a move operation. How should I proceed with this?
Secondly, how can I display the array into the Script Log window for testing purposes? I tried DOpus.Output (don't know how I can use it to display the values of DOpus.vars) and DOpus.vars.Get and some other random stuff. The manual is also confusing me haha.
Also, I'm using the OnGetCopyQueueName event and therefore the limitation of that is the Automatically manage file copy queues must be on otherwise it won't work right?
The last question I have is I remember reading somewhere that global variables are written to a file. This is what allows them to survive reboots. I tried looking around the only file I found was uservars.oxc. But that's not the file it seems. Where do DOpus store these reboot-proof variables?
Can you give me guidance on this? Thanks! Or... you could implement this feature into DOpus one day?