Dialog Designer wandering off the screen

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Dialog Designer wandering off the screen

Post by Grovkillen » Fri Feb 19, 2021 10:49 am

I get the problem of the dialog designer sometimes not showing up... It seems like it's open way off the screen. As a note of information; I do have multiple screens in my office but once out and about I only have my small laptop screen. Would it make sense to have the Dialog Designer as a separate window on the taskbar? It's now hidden and I cannot use the good-ol "CTRL + right click, "move" option + arrow key, move mouse" to get the window to follow the mouse cursor.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Dialog Designer wandering off the screen

Post by Grovkillen » Fri Feb 19, 2021 10:51 am

Meta-solution:

Code: Select all

MoveWindow>Dialog Designer,0,0
Problem solved but request is still valid.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1378
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Dialog Designer wandering off the screen

Post by Dorian (MJT support) » Fri Feb 19, 2021 11:13 am

Just thinking aloud... Does restarting Macro Scheduler solve this?

Could it be storing the coordinates from when you have multiple monitors, then trying to place it somewhere that no longer exists?

Although I am imagining your laptop has probably been switched off while it was moving from place to place so my theory may be invalid.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Dialog Designer wandering off the screen

Post by Grovkillen » Fri Feb 19, 2021 11:41 am

Yeah I tried that. Also killing the process... to no avail.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7393
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Dialog Designer wandering off the screen

Post by Marcus Tettmar » Mon Feb 22, 2021 1:02 pm

Do you have pin to designer set? and could your script be positioning the window (or is it being moved off the screen when running the script)? If so then when you later open the designer it is probably just moving to the same place as set by the script or moved to ...
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Dialog Designer wandering off the screen

Post by Grovkillen » Mon Feb 22, 2021 1:53 pm

Not pinned and not moved by any script.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Dialog Designer wandering off the screen

Post by Grovkillen » Tue Apr 20, 2021 10:07 am

Since this happens all the time I have created myself a script that I run after I have opened up a project:

Code: Select all

Let>OFFSET_VALUE=70
Let>OFFSET_COUNT=0
Let>START_x=-2800
Let>START_y=-1000

Let>WINDOW_width=1500
Let>WINDOW_height=1000

GetWindowList>OPEN_WINDOWS
Separate>OPEN_WINDOWS,%CRLF%,WINDOW_ARRAY
If>WINDOW_ARRAY_count>0
  Let>k=0
  Repeat>k
    Let>k=k+1
    Let>TEMP_window_title=WINDOW_ARRAY_%k%
    UpperCase>TEMP_window_title,TEMP_window_title_raw
    Position>EDITOR -,TEMP_window_title_raw,1,TEMP_editor_window,False
    Let>OK_TO_RESIZE=False
    If>TEMP_editor_window>0
      Let>OK_TO_RESIZE=True
      StringReplace>TEMP_window_title_raw,EDITOR -,,TEMP_window_title_raw
      Trim>TEMP_window_title_raw,TEMP_window_title_raw
      ExtractFileExt>TEMP_window_title_raw,TEMP_ext
      If>TEMP_ext=.SCP
        Let>OK_TO_RESIZE=True
      Endif>
    Endif>
    If>OK_TO_RESIZE=True
      GetWindowSize>TEMP_window_title,TEMP_width,TEMP_height
      ResizeWindow>TEMP_window_title,%WINDOW_width%,%WINDOW_height%
      SetFocus>TEMP_window_title
      Let>TEMP_x={%START_x%+%OFFSET_COUNT%*%OFFSET_VALUE%}
      Let>TEMP_y={%START_y%+%OFFSET_COUNT%*%OFFSET_VALUE%}
      MoveWindow>TEMP_window_title,TEMP_x,TEMP_y
      MoveWindow>Dialog Designer,TEMP_x,TEMP_y
      Add>OFFSET_COUNT,1
    Endif>
  Until>k=WINDOW_ARRAY_count
Endif>
Using a Stream Deck from Elgato it's just a click away.

Image

Only problem now is that the commands/variable list to the left is sometimes 1000+ pixels wide. I have yet to find how to set that width using a script.

I also have this little snippet:

Code: Select all


Separate>MSCHED_VER,.,VERSION_ARRAY
Let>REGISTRY_VALUE="C:\Program Files (x86)\Macro Scheduler %VERSION_ARRAY_1%\msched.exe" "-EDITOR" "%1"
RegistryReadKey>HKEY_CLASSES_ROOT,msched\shell\open\command,,CURRENT_KEY_VALUE
IfNot>CURRENT_KEY_VALUE=REGISTRY_VALUE
  //RegistryWriteKey>HKEY_CLASSES_ROOT,msched\shell\open\command,,REGISTRY_VALUE
  Let>REGISTRY_TEXT=Windows Registry Editor Version 5.00%CRLF%%CRLF%[HKEY_CLASSES_ROOT\msched\shell\open\command]%CRLF%@="\"C:\\Program Files (x86)\\Macro Scheduler %VERSION_ARRAY_1%\\msched.exe\" \"-EDITOR\" \"%1\""
  IfFileExists>%SCRIPT_DIR%\openInEditor.reg
    DeleteFile>%SCRIPT_DIR%\openInEditor.reg
  Endif>
  WriteLn>%SCRIPT_DIR%\openInEditor.reg,,REGISTRY_TEXT
  ExecuteFile>%SCRIPT_DIR%\openInEditor.reg
Endif>
Last edited by Grovkillen on Tue Apr 20, 2021 6:13 pm, edited 2 times in total.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Dialog Designer wandering off the screen

Post by Grovkillen » Tue Apr 20, 2021 1:17 pm

Ah... I have now fixed my issue to 100% :)

Here's the fix which also resize the internal window for the "Code Builder":

Code: Select all

Let>OFFSET_VALUE=70
Let>OFFSET_COUNT=0
Let>START_x=100
Let>START_y=20
Let>CODE_BUILDER_WIDTH=400
Let>WINDOW_width=1500
Let>WINDOW_height=1000

GetWindowList>OPEN_WINDOWS
Separate>OPEN_WINDOWS,%CRLF%,WINDOW_ARRAY
If>WINDOW_ARRAY_count>0
  Let>k=0
  Repeat>k
    Let>k=k+1
    Let>TEMP_window_title=WINDOW_ARRAY_%k%
    UpperCase>TEMP_window_title,TEMP_window_title_raw
    Position>EDITOR -,TEMP_window_title_raw,1,TEMP_editor_window,False
    Let>OK_TO_RESIZE=False
    If>TEMP_editor_window>0
      Let>OK_TO_RESIZE=True
      StringReplace>TEMP_window_title_raw,EDITOR -,,TEMP_window_title_raw
      Trim>TEMP_window_title_raw,TEMP_window_title_raw
      ExtractFileExt>TEMP_window_title_raw,TEMP_ext
      If>TEMP_ext=.SCP
        Let>OK_TO_RESIZE=True
      Endif>
    Endif>
    If>OK_TO_RESIZE=True
      GetWindowHandle>TEMP_window_title,TEMP_window_handle
      IfNot>TEMP_window_handle=0
        GetWindowSize>TEMP_window_title,TEMP_width,TEMP_height
        ResizeWindow>TEMP_window_title,%WINDOW_width%,%WINDOW_height%
        SetFocus>TEMP_window_title
        Let>TEMP_x={%START_x%+%OFFSET_COUNT%*%OFFSET_VALUE%}
        Let>TEMP_y={%START_y%+%OFFSET_COUNT%*%OFFSET_VALUE%}
        MoveWindow>TEMP_window_title,TEMP_x,TEMP_y
        MoveWindow>Dialog Designer,TEMP_x,TEMP_y
        Add>OFFSET_COUNT,1
        Let>WIN_USEHANDLE=1
        GetWindowChildList>TEMP_window_handle,TEMP_window_child_handle
        Let>WIN_USEHANDLE=0
        Separate>TEMP_window_child_handle,%CRLF%,TEMP_child_handle_array
        If>TEMP_child_handle_array_count>0
          Let>c=0
          Repeat>c
            Let>c=c+1
            Let>TEMP_child_window_handle=TEMP_child_handle_array_%c%
            Let>WIN_USEHANDLE=1
            UIAccessibleList>TEMP_child_window_handle,TEMP_ui_elements
            Separate>TEMP_ui_elements,%CRLF%,TEMP_check_array
            Position>{"Code Builders"},TEMP_check_array_1,1,TEMP_check_if_correct,False
            If>TEMP_check_if_correct>0
              GetWindowParent>TEMP_child_window_handle,1,TEMP_parent_handle
              ResizeWindow>TEMP_parent_handle,CODE_BUILDER_WIDTH,WINDOW_height
              Let>c=TEMP_child_handle_array_count
            Endif>
            Let>WIN_USEHANDLE=0
          Until>c=TEMP_child_handle_array_count
        Endif>
      Endif>
    Endif>
  Until>k=WINDOW_ARRAY_count
Endif>
Let>ME=%Script%

Running: 15.0.27
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts