Post Reply
mnw 2011-05-14 23:18
Can anyone help on this. I'm trying to write a script that will detect the current (applied) profile name and then apply a different profile depending on the current on applied. Something like this.
if current profile = "profile1" then apply "profile2" else if current profile = "profile2" then apply "profile3" else apply "profile1"
I'm sure it's not too tricky, is it?
Cheers
Mnw
|
Christian Studer 2011-05-15 09:04
There's no direct way to tell which profile is currently active, but the script can look at the current display configuration (resolution, position etc of each monitor), and then change settings as desired directly, no display profile needed.
If you're interested in this, post the display configuration from UltraMon menu > About for each setup, and I'll send you a sample script which does this.
Christian Studer - www.realtimesoft.com
|
mnw 2011-05-15 11:07
Cheers! Here's my setup for the first major profile.
2 monitors Current desktop: 1920x1848 (0,0 - 1920,1848)
Monitor 1 - SG7 : Settings: 1024x768, 32-bit color, 60 Hz refresh rate Coordinates: 445,1080 - 1469,1848. Workspace: 445,1080 - 1469,1848 Video card: NVIDIA GeForce GTX 460 Device: \\.\DISPLAY2\Monitor0
Monitor 2 - SAMSUNG (primary): Settings: 1920x1080, 32-bit color, 60 Hz refresh rate Coordinates: 0,0 - 1920,1080. Workspace: 0,0 - 1920,1032 Video card: NVIDIA GeForce GTX 460 Device: \\.\DISPLAY1\Monitor0
The second profile should disable the SG7 screen leaving its icons on it...and when it re-enables ensure the correct position. (ToggleSingleMon fails to do this).
Generally very handy software with great potential.
|
Christian Studer 2011-05-16 08:25
Here's a script which does this:Set sys = CreateObject("UltraMon.System")
If sys.NumActiveMonitors = 1 Then
'only monitor 2 enabled, enable monitor 1 and restore icon positions
Set mon = sys.Monitors("1")
mon.Enabled = True
mon.Width = 1024
mon.Height = 768
mon.Orientation = 0 'landscape
mon.Colordepth = 32
mon.RefreshRate = 60
mon.Interlaced = False
mon.Left = 445
mon.Top = 1080
sys.ApplyMonitorChanges
sys.RestorePositions 2 'icons
Else
'both monitors enabled, save icon positions and disable monitor 1
sys.SavePositions 2 'icons
Set mon = sys.Monitors("1")
mon.Enabled = False
sys.ApplyMonitorChanges
End IfDuring testing I noticed that I had to restore icon positions twice in order for it to work correctly, if that's the case on your system as well just duplicate the line
sys.RestorePositions 2
Christian Studer - www.realtimesoft.com
|
Post Reply
|