Page 1 of 2

Having fun with multiple monitors

Posted: Tue Mar 10, 2020 1:07 pm
by richmond62
I thought I would be clever (normally a bad idea in my case), so set up a preferences page
in my Devawriter Pro:
-
Prefs.jpg
-
This pops a value into a custom property of the main stack
called "POZZZ": "LL", "MM" or "RR" (which should be self-explanatory).

Should all be dead simple . . .

HOWEVER
, I have 3 monitors attached to my Mac Mini:
-
Screenshot 2020-03-10 at 14.04.12.png
-

BUT when I click on the right-hand picture the stack ends up on the right hand side of my left-most monitor,

when I click on the left hand side picture the stack ends up on the left hand side of the central monitor.

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 1:27 pm
by Klaus
What did you script for this so far? That info COULD be helpful.
Do you use -> line 1 of the screenrects as the reference for positioning the stack? 8)

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 1:43 pm
by richmond62
line 1 of the screenrects
A line that is worth such a lot . . .

I'm doing this:

Code: Select all

switch the POZZZ of stack "DWPro"
      put ((item one of the screenLoc) * 2) into WIDD
   case "LL"
      set the left of stack "DWPro" to 10
      break
   case "RR"
      set the right of stack "DWPro" to (WIDD - 10)
      break
   case "MM"
      set the loc of stack "DWPro" to the screenLoc
      break
end switch

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 2:07 pm
by richmond62
This:

Code: Select all

switch the POZZZ of stack "DWPro"
      put (item 3 of line 1 of the screenrects) into WIDD
      put (item 4 of line 1 of the screenrects) into HITE
   case "LL"
      set the left of stack "DWPro" to 10
      set the top of stack "DWPro" to 100
      break
   case "RR"
      set the loc of stack "DWPro" to (WIDD - 510),(HITE/2)
      set the top of stack "DWPro" to 100
      break
   case "MM"
      set the loc of stack "DWPro" to the screenLoc
      set the top of stack "DWPro" to 100
      break
end switch
if POZZZ is "RR" still pushes the stack over onto the right hand side of the left hand monitor.

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 2:26 pm
by Klaus
What about this one:

Code: Select all

...
  lock screen
  
  ## Not sure if it is a good idea to put this inside of the SWITCH structure.
   put (item 3 of line 1 of the screenrects) into WIDD
   put (item 4 of line 1 of the screenrects) into HITE
   switch the POZZZ of stack "DWPro"
      case "LL"
         set the left of stack "DWPro" to 10
         break
      case "RR"
         ## !!! Just like LL
         set the right of stack "DWPro" to WIDD
         ## !!! 8-)
         break
      case "MM"
         set the loc of stack "DWPro" to the screenLoc
         break
   end switch
   
   ## Avoid too much typing:
   set the top of stack "DWPro" to 100
   unlock screen
...

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 2:34 pm
by richmond62
Still throws the stack off to the left monitor with "RR"

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 2:39 pm
by Klaus
Please post all lines of your "screenrects".
-> item 3 of line 1 of the screenrects ## WIDD
Is definitively the right border of your main monitor, so this SHOULD do the right thing.

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 3:39 pm
by richmond62
0,0,1920,1080
1920,0,3200,1024
-1600,0,0,1200

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 3:49 pm
by Klaus
OK, what I exspected. So:

Code: Select all

answer WIDD
Should show -> 1920
Does it?

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 4:26 pm
by richmond62
NO: neither

Code: Select all

answer WIDD
or

Code: Select all

put WIDD
inwith the cardScript return anything at all.

BUT

Code: Select all

put (item 3 of line 1 of the screenrects)
returns 1920 when I run it in the messageBox.

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 4:28 pm
by Klaus
Please post your final/last script that does not work!

Maybe I was right with?
## Not sure if it is a good idea to put this inside of the SWITCH structure.

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 4:36 pm
by richmond62
You are a genius (or just gifted with the voice of experience) as moving 'that' out
of the switch statement did the job:

Code: Select all

on preOpencard
   set the vis of stack "DWPro" to false
   set the lockScreen to true
   set the title of stack "DWPro" to "       "
   set the width of stack "DWPro" to 1000
   set the height of stack "DWPro" to 688
   ---
   put (item 3 of line 1 of the screenrects) into WIDD
   put (item 4 of line 1 of the screenrects) into HITE
   put WIDD
   ---
   switch the POZZZ of stack "DWPro"
      case "LL"
         set the left of stack "DWPro" to 10
         break
      case "RR"
         set the right of stack "DWPro" to (WIDD - 10)
         break
      case "MM"
         set the loc of stack "DWPro" to the screenLoc
         break
   end switch
   set the top of stack "DWPro" to 100
   set the lockScreen to false
   set the vis of stack "DWPro" to true
end preOpencard

HOWEVER
. . . I wish I could understand why that was not working inside the switch structure.

Thank you for taking the time to help me, once again. :D

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 4:43 pm
by Klaus
I already posted this two hours ago, why didn't you take my advice the first time resp. tried my script?
That was a rhetorical question! 8)

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 5:16 pm
by richmond62
why didn't you take my advice the first time
How can I start?

Bloody-mindedness?

Likes to paddle his own canoe?

Death-wish? 8)

It wasn't really 2 hours as I was asleep with the cat for 1 hour of that. :D

HOWEVER
. . . I still do not understand why putting data into a variable inside a switch statement did not work.

Re: Having fun with multiple monitors

Posted: Tue Mar 10, 2020 5:43 pm
by Klaus
Maybe because it just doesn't work this way?
Since this is not related to SWITCH in any way?

And please look up "rhetorical" somewhere. :D