Here is a little Add-in to get you started. Be careful not to create circular references, otherwise Opus might be opening tabs until doomsday.
// myStart
// This is a script for Directory Opus.
// See https://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.
// Called by Directory Opus to initialize the script
function OnInit(initData) {
initData.name = "myStart";
initData.version = "1.0";
initData.copyright = "";
// initData.url = "https://resource.dopus.com/viewforum.php?f=35";
initData.desc = "";
initData.default_enable = true;
initData.min_version = "12.0";
}
// Called when Directory Opus starts up
function OnStartup(startupData) {
DOpus.Output('I just started...');
}
// Called when a new tab is opened
function OnOpenTab(openTabData) {
var cmd = DOpus.Create.Command;
// cmd.RunCommand('Go D:\test');
DOpus.Output('OnOpenTab got triggered');
}
Thanks guys. I have created a user command suggested by Leo to be used at startup and it works a treat - just what I need.
So far as the tab function mentioned by @lxp, I am a little confused. DO I simply place this in the scripts directory and then it works, or do I have to do something else?
Function OnOpenTab(openTabData)
Dim cmd
set cmd = DOpus.NewCommand
cmd.SetSourceTab(openTabData.tab)
cmd.RunCommand "Select DATE=newest TYPE=files"
End Function
The open tab event is fired when the tab opens, but until the folder has been read there won’t be anything to select. You probably want to use the OnAfterFolderChange event.