// TabletMode // This is a script for Directory Opus. // See http://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 = "TabletMode"; initData.version = "1.0"; initData.copyright = "(c) 2016 Leo Davidson"; initData.url = "https://resource.dopus.com/viewtopic.php?f=3&t=26920"; initData.desc = "Example script"; initData.default_enable = true; initData.min_version = "12.0.8"; var cmd = initData.AddCommand(); cmd.name = "SwitchTabletMode"; cmd.method = "OnSwitchTabletMode"; cmd.desc = "Switch existing lister into tablet mode or open a new one in that mode"; cmd.label = "SwitchTabletMode"; cmd.template = ""; cmd.hide = false; cmd.icon = "script"; } // Implement the SwitchTabletMode command function OnSwitchTabletMode(scriptCmdData) { var cmd = DOpus.Create.Command(); // Open a new lister if none are already open. if (DOpus.listers.count == 0) { cmd.RunCommand("Go NEW"); } // Send commands to the last active lister (if we just opened one then it'll be that one). cmd.SetSourceTab(DOpus.listers.lastActive.activetab); cmd.AddLine('Toolbar "Tablet Mode" LOADSET=replace'); cmd.AddLine('SET FORMAT="Touch Format"'); cmd.AddLine('SET FORMATLOCK=on'); cmd.AddLine('SET HIDESYSTEMFILES=on'); cmd.AddLine('SET LISTERTITLE="dOpus Touch (%N)"'); cmd.AddLine('SET SHOWCOMPATIBILITYFILES=off'); cmd.AddLine('SET TREE=off'); cmd.AddLine('SET FONTSCALE=175'); cmd.AddLine('SET METAPANE=off'); cmd.AddLine('SET VIEWPANE=off'); cmd.AddLine('SET LISTERCMD=ToFront'); cmd.AddLine('SET LISTERCMD=Maximize'); // Best to do this last. cmd.Run(); }