Different listers on different screens

Hi Leo,

Thanks for looking. When you say VBScript I'm taking it that you mean the normal Windows VBScript, right?

Well (not my original work, but) would this bit of VBScript help in any way. It gives you monitor details?

strComputer = "."
 Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")  

Set colItems = objWMIService.ExecQuery("Select * from Win32_DesktopMonitor")

For Each objItem in colItems
     wsh.echo "Monitor:"
     Wscript.Echo "Availability: " & objItem.Availability
     Wscript.Echo "Bandwidth: " & objItem.Bandwidth
     Wscript.Echo "Description: " & objItem.Description
     Wscript.Echo "Device ID: " & objItem.DeviceID
     Wscript.Echo "Display Type: " & objItem.DisplayType
     Wscript.Echo "Is Locked: " & objItem.IsLocked
     Wscript.Echo "Monitor Manufacturer: " & objItem.MonitorManufacturer
     Wscript.Echo "Monitor Type: " & objItem.MonitorType
     Wscript.Echo "Name: " & objItem.Name
     Wscript.Echo "Pixels Per X Logical Inch: " & objItem.PixelsPerXLogicalInch
     Wscript.Echo "Pixels Per Y Logical Inch: " & objItem.PixelsPerYLogicalInch
     Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
     Wscript.Echo "Screen Height: " & objItem.ScreenHeight
     Wscript.Echo "Screen Width: " & objItem.ScreenWidth
   wsh.echo
 Next

If you can give me a starter for ten on how to write scripts for DOpus and where to put them, ruyn them etc., I'll have a go at building a suitable scripts.

If this doesn't work in DOpus then I'll leave it, but if I'm on the right track then I'll now look for a bit of script to get the mouse position.

Dave

Normal VBScript, yes. They run in Opus with some extra objects available, but anything you can do in a normal VBScript should work in Opus as well. Scripting in the manual is the best place to start.

That doesn't give you the monitor's coordinates (only its size), so even with the mouse position you wouldn't be able to know which monitor it was on.

Unfortunately, I don't think there is a good way to get the mouse position, either.

The script could open a window and then adjust it based on which monitor it is on, if that would work. It wouldn't be as good as opening the right window straight away, since it would mean things open, display, and then adjust, with a bit of flickering.

Hi Leo,

Ok, true, but Opus must know which screen has been double clicked to open a lister on it? Could you make this parameter available to the scripting objects - probably a new release, might make me upgrade to Opus 11 :slight_smile:

In the meantime, if I can find a script which tells me which screen the mouse is on and then I can find out if it is portrait or landscape from the above script I should be able to set change the lister view, right?

Dave

Yes, we could add the mouse and monitor information to the scripting API. This would be a good use for it. We'll consider it for the future.

The next update will allow for a script like this (which I'll upload to the forum once the required update is released) which will cover what you wanted to do:


Works for monitors as well as arbitrary areas of the screen, so you could also do different things in the left and right halves of a monitor, for example.

11.15.3 (beta) is now available, and I have put the script and instructions here: Trigger actions by the area/screen the mouse is on

Hi Leo,

Sorry for the delay in getting back to you, but just to say "Absolutely Perfect", works like a charm :smiley:

Have now upgraded to Opus 11 and ever since the Amiga daya, this is still the best Directory program - many thanks

Dave

I'm using 12.20.8 Beta.

I have 2 monitors:
In front of me 2560x1440 (nr. 1 in WIndows)
To my left 1920x1080 (nr 2 in WIndows)

I've done everything exactly as mentioned. When I now double-click on the desktop on monitor 2, the correct lister layout is opened, but on monitor 1.

How can I fix this?

Thanks,
Roland

Did you save the layout with the lister on the monitor you want it to open on?

I did not, but now I did. Now DOpus opens on the 1920x1080 screen with the cooresponding layout, but the left lister is different than the right lister. The left lister now defaults to folder "C:\Program Files\Directory Opus\Prefs". The columns do not match the right lister and the folder tree is as short as possible.

Opening the 1920x1080 lister setup via DOpus on the first monitor works fine. DOpus is opened on the 1920x1080 monitor with both listers as configured.

Presumably you are opening a different layout for each monitor.

You probably want to turn on Preferences / Layouts and Styles / Layouts / Ignore folder formats saved within this layout for both of the layouts you are using, so they don't override your normal columns etc.

You will also want to save the respective layout for each monitor as you want things set up for that monitor. You can't use a single layout for both monitors, if you want them to each be different sizes.

Your suggestion for the option unfortunately had no effect. The Prefs-folder is still opened at startup and the columns are the wrong sizes.
When I open the new lister from the layout menu it works fine. I can make a screenshot or video if that would help.

Nothing discussed in this thread would affect what happens at startup (other than that startup may open windows it remembered were previously open, and those windows may have been opened via the layouts/commands discussed here).

You can change what happens when something triggers the default lister opens (e.g. if something asks for a folder to open, or you click the Opus taskbar icon when it's already running but has no windows open), and when Opus launches (e.g. if it's set to run when Windows boots) under Preferences / Launching Opus, on the Default Lister and Startup pages.

I noticed something: in the post where you explain how to set it up (where the "Area Command"-script is posted), it has as example command "Go Prefs Layout="<My Layout". That explains why the Prefs-folder is opened on startup.
I changed it to the default folder I have opened in the right lister and now it starts in the correct folder.
It now says

Go "D:\Downloads" LAYOUT="1920x1080"

for Area_1_Command. Only the column widths are still not the same as the right lister.

The width of these colums are the same as the with on the lister that is set as default. Setting these column widths to Fill, Auto and Auto for my three columns, saving them and setting it as default lister has no effect.

It doesn't say that. The examples it gives are:

Go NEW (which opens a default lister)

Prefs LAYOUT="My Layout" (which opens a layout called "My Layout").

There is no Go in the second command.

Have you configured the layout to override the normal Folder Formats?

(Make sure Preferences / Layouts and Styles / Layouts / Ignore folder formats saved within this layout is turned off for the layout in question, if you want it to use its stored columns and column sizes.)

You're right, I missed something. The Go should not be in the command. I removed it and now it's working fine, thanks :slight_smile:

1 Like

Hi, I've changed my monitor layout and now have a extra wide screen on the bottom and two 4K screens on the top
image

The bottom screen is 5120 x 1440 at 100%
The two top screens are 3840 x 2160 at 100%
Ignore screen 4 as its a dummy screen so I can present small scale presentaiton while on line

The area commands now do not work correctly.

In practice there is no correlation bewteen the actual mouse pointer and the lanuching of layouts. Using a mouse pointer capture program I get this for the top screens
image
And this for the bottom screen
image

The only difference I can see is in the Raw DPI value.

Any thoughts on why the script isn't working anymore - note it did work when I just had multiple monitors which were all the same.

Thanks Dave

I've added something to the bottom of the main script post which will help you work out the right coordinates. This link should take you to the right section but, if not, it's near the bottom of the first post:

Many thanks Leo, perfect :slight_smile:

Hi Leo,

Area command has just stopped working and I can't see why.

Doubling clicking on the screen can bring up the defualt lister for example, but when I set it to run areacommand, nothing happens any more. This was working perfectly, but I can remember when it stopped as I just justed the icon to open a lister while doing other things, but I'd like to see if I can get it working again, it was really useful.

I put an alert message in the script, but that doesn't get executed.

Is there anything else I can try to find out why its not working?

Mnay thanks
Dave