Display a usesr prompt on a SPECIFIC screen where there are multiple screens

I am going round on circles, so maybe someone has a better idea.

Q1: Which screen does screenindex 1 refer to?
https://wiki.keyboardmaestro.com/function/SCREEN?redirect=1

Q2: The idea behind these two macros is to display a prompt on a SPECIFIC screen
e.g. is this the primary screen? is this your secondary screen?
In the first macro you can vary the screenindex and run the macro

The second macro is there as someone suggested splitting off the prompt into a separate macro.
The two macros load into [Xampl] macro group.
It does not matter if the prompt is the KM default or a Custom HTML.

In some tests, it shows on the wrong screen first time, but the correct screen second time.

I have tried differrnet ways of changing the "focus" to the target screen.

Any ideas welcomed.

===================================

===================================
[Xample] Trying to force a prompt or custom HTML on a specific screen Macros.kmmacros (13.6 KB)

Q1 Usually 1 is the secondary screen as I understand and 0 the main screen.
Q2 Look at this macro below, you can set the mouse location to switch focus to an other screen and then prompts after that should appear on the screen the focus is on.

The JMichaelTx sollution is using OSX spaces and Mission Control, which is a solution, but I would still like to try and do it without that.

The answer is directly in the link you provided:

The SCREEN index can be referenced by either a number OR a name . The Index number can be 0 for the main screen, and then 1 through n are the screens in orientation order from left to right (and top down for screens at the same position).

So what is your actual question?

The Prompt for User Input action will display on the Active, Front Most Screen. So if you want it to display elsewhere, then you need to first click on a window in the Screen where you want the prompt to appear.

OR, you can use this Sub-Macro, called ASYNCHRONOUSLY, with the Target Screen# as its Parameter, just before the Prompt for User Input:

Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.

Please let us know if it meets your needs.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Move Keyboard Maestro (KM) Prompts and Alerts [Sub-Macro]

-~~~ VER: 1.0    2020-06-07 ~~~
Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Move Keyboard Maestro (KM) Prompts and Alerts [Sub-Macro].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Author.@JMichaelTX

PURPOSE:

  • Move the KM Prompt or Display Text to Desired Screen

NOTICE: This macro/script is just an Example

  • It is provided only for educational purposes, and may not be suitable for any specific purpose.
  • It has had very limited testing.
  • You need to test further before using in a production environment.
  • It does not have extensive error checking/handling.
  • It may not be complete. It is provided as an example to show you one approach to solving a problem.

REQUIRES:

  1. KM 8.0.2+
  • But it can be written in KM 7.3.1+
  • It is KM8 specific just because some of the Actions have changed to make things simpler, but equivalent Actions are available in KM 7.3.1.
    .
  1. macOS 10.11.6 (El Capitan)
  • KM 8 Requires Yosemite or later, so this macro will probably run on Yosemite, but I make no guarantees. :wink:

MACRO SETUP

  • Carefully review the Release Notes and the Macro Actions
    • Make sure you understand what the Macro will do.
    • You are responsible for running the Macro, not me. :wink:
      .
  • Assign a Trigger to this maro.
  • Move this macro to a Macro Group that is only Active when you need this Macro.
  • ENABLE this Macro.
    .
  • REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:
    • ALL Actions that are shown in the magenta color

USE AT YOUR OWN RISK

  • While I have given this limited testing, and to the best of my knowledge it will do no harm, I cannot guarantee it.
  • If you have any doubts or questions:
    • Ask first
    • Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.


Example Macro That used the Above Sub-Macro

  • Use Parameter set to Screen#
  • Check "Asynchrononously" in Gear Options

image

image

1 Like