With SysGet, example 2 on https://autohotkey.com/docs/commands/SysGet.htm, I fetch %MonitorWorkAreaLeft%. This prints as expected. With my left most monitor, I see the next text:
Code: Select all
Monitor: #3
Name: \\.\DISPLAY3
Left: -1600 (-1600 work)
Top: 0 (0 work)
Right: 0 (0 work)
Bottom: 1200 (1200 work)
Code: Select all
; VissionApp on highest monitor number.
SysGet, VissionAppMonitor, MonitorCount
SysGet, MonitorName, MonitorName, %VissionAppMonitor%
SysGet, Monitor, Monitor, %VissionAppMonitor%
SysGet, MonitorWorkArea, MonitorWorkArea, %VissionAppMonitor%
; use the work areay, not the full area to leave room for the windows bar
; resize to a little smaller than the monitor size (50 pixels within the monitor)
VissionAppSubTop := (%MonitorWorkAreaTop% + 50)
VissionAppSubLeft := (%MonitorWorkAreaLeft% + 50)
VissionAppSubRight := (%MonitorWorkAreaRight% - 50)
VissionAppSubBottom := (%MonitorWorkAreaBottom% - 50)
WinMove, VissionAppCBee - visionapp Remote Desktop,, %VissionAppSubLeft%, %VissionAppSubTop%, %VissionAppSubRight%, %VissionAppSubBottom%
Code: Select all
Error: The following variable name containts an illegal character: "-1600"
Line#
043: SysGet, MonitorName, MonitorName, %VissionAppMonitor%
044: SysGet, Monitor, Monitor, %VissionAppMonitor%
045: SysGet, MonitorWorkArea, MonitorWorkArea, %VissionAppMonitor%
046: VissionAppSubTop := (%MonitorWorkAreaTop% + 50)
---> 047: VissionAppSubLeft := (%MonitorWorkAreaLeft% + 50)
048: VissionAppSubRight := (%MonitorWorkAreaRight% - 50)
046: VissionAppSubBottom := (%MonitorWorkAreaBottom% - 50)
Is there something I can do to work around this issue? Should I use a 'convert text to number' function? (which one?).
The program works as long as my primary monitor is the top and/or left most monitor. However, the program fails if I like to put a window on any window with negative locations, like one on the left or one at the top.