Application Launch Trigger Does Not Seem to Work for VLC and IINA

I've just purchased KM and after much research I've created my first Macro:

I want two video applications (VLC and IINA) to always open in full screen on my primary display (a projector connected to my MacBook Pro running Mojave 10.14.6, which is my secondary display).

Below please see the macro I've created. KM Interactive Help is telling me all is well (it suggested adding a Pause - which I have - but this makes no difference whatsoever).

Why are VLC and IIMA completely ignoring KM?

Any help will be greatly appreciated. Thank you.

Do you mean full screen as in "zoomed to the edges of the screen" or do you mean full-screen as "nothing else shows up"?

If the latter, I would use VLC » Video » Fullscreen or IINA » Video » Enter Full Screen.

Thank you for your reply tjluoma

I do mean full screen as in "nothing else shows up" (I use the projector to fill a planetarium dome)

The thing is, even with the application full screen options enabled:

  • VLC only succeeds 90% of the time. 10% of the time it opens up on my laptop screen and I then have to drag it across to the dome screen (which looks very unprofessional to my audiences)

  • IINA is still new and I haven't used it much - but it appears to be temperamental at times too.

From everything I can see online, KM should have no problem opening applications in external windows. Yet for some reason, it has having absolutely no effect on my VLC and IINA.

Is that not strange? Is it a bug perhaps? Or is there something I'm not doing correctly? (I hope it's the latter!)

Unfortunately I don't have a 2nd monitor to test this with, so I can only help via speculation and guesswork.

First, I would make 1 macro for VLC, and once you get it to work, Duplicate it and edit to work with IINA. That way if you need to make some changes, you can, but each one can work independently of the other.

Second, I'll suggest VLC since I know that one better (I, too, have only started using IINA). Make the "Pause Until" wait until VLC is at the front and that the front window exists. (It shouldn't matter what is in the front window, just as long as VLC has a front window.)

Third: move the window to the screen that you want it on. (This is the part I can't really help with.)

Fourth: make it full-screen.

If that still doesn't seem to work, post your full macro and maybe someone here can spot what might be the breakdown in communication.

Well, the first step in troubleshooting something like this, is to confirm/correct that you have the Projector setup as the "Main" screen.

  1. Have you done this using the macOS Preferences > Display?
  2. With a VLC or IINA window open in the "Main" screen, run this test macro:

MACRO:   Move Window to "Main" Screen

**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:
<a class="attachment" href="/uploads/default/original/3X/8/6/86f00502abf375a9f114bf0f812f581937815210.kmmacros">Move Window to "Main" Screen.kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**


---


<img src="/uploads/default/original/3X/7/d/7db9d4d285de7a3e9611af4d84f892e27046f6d0.png" width="475" height="764">

`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

Then, to test if KM can "see" windows in your apps:

1. Activate VLC (or IINA)
2. Pause Until VLC is at the front
3. Display Window 
   * Front Win Name: %WindowName%1%
   * Front Win Frame: %WindowFrame%1%

Once we know for sure that:
1. KM can "see" your apps
2. Your Projector is in fact the "Main" screen

then we can work on making full screen -- which should be easy.

Thank you for creating the test macro JMichaelTX

I hope I am understanding / executing this correctly, but this is what happens:

I begin with the test macro open & enabled on my secondary display (laptop):

I have VLC Warp (a slightly modified planetarium version of VLC) open and running on my primary display (projector).

I then click on Run at the top of the KM Editor.

Result:

the KM Editor window moves to the primary display (projector):

... and a KM Display Text window opens on my secondary display (laptop):

I'm not sure what this means (or if I'm doing it right)?

Thank you for the follow-up advice.

The thing is, I did originally begin with a single macro for the VLC app - but it also completely ignored the KM macro. I tried positioning the VLC window in different places and different screens, but it never responded to any of the KM instructions.

It's as if the VLC and IINA apps are not aware of / listening to the KM instructions (?)

No.
Assign a hot key to the test macro.
Select/activate the VLC window.
Trigger the macro.

OK cool, thank you.

I assigned a hot key to the enabled test macro:

I activated VLC ... it opens on the secondary display (laptop).

I hit the trigger key.

VLC jumps to the top left corner of the primary display (projector) [ Hurrah! :partying_face: ]

The KM display text window opens on the laptop screen:

OK this is brilliant, so the app windows ARE responding to KM via a hot key. In fact, I have assigned a hot key to my macro and the active window DOES respond to the hot key:

Two problems remain:

  1. the windows do not open in true Fullscreen ie. they are "zoomed to the edges of the screen", but not "full-screen as nothing else shows up"

  2. why do the windows not obey KM in the original macro ie. why is the macro not triggered by the applications launching?

Thank you for all the progress we've made so far!

Simply add this action after the move:

image

I don't know. Since I don't have your apps, I can not test.
But in general the Application Launch trigger works well.
You may need to add a Pause Until the app if frontmost, and maybe a small Pause (like 0.2 sec).

OK this is wonderful progress JMichaelTX, thank you VERY MUCH for your help.

I have now run out of time, so I will return to this problem on the weekend and attempt your final suggestion with the Pause.

I will update you as soon as I have more information.

Thank you again!

OK I've tried adding various pauses to the VLC and IINA macros, but it makes no difference.

Yet interestingly, something happened with QuickTime Player that may be a clue as to the possible problem with VLC and IINA.

When I created the same 'launch + move to main screen + enter fullscreen' macro for QuickTime Player, I first received the following notice:

I allowed permission - and QuickTime Player launches and obeys the KM macro every time.

Yet never have I been asked the same permission for VLC and IINA. Could this be the reason why KM does not see VLC or IINA when they launch?

On the other hand, VLC and IINA obey KM when the macro is triggered by a hot key.

So that's what I'm doing right now: relying on the hotkey to launch the macro.

Yet it would be nice if VLC and IINA obeyed the macro on launching - just as QuickTime Player does.

Please see Accessibility Permission Problem assistance.

That looks like the Automation permission, which controls AppleScript control of an Application. See the Automation settings in the System Preferences, Security & Privacy preferences.

I think we're definitely on the right track here.

QuickTime Player has KM automation permission, but VLC and IINA don't. Yet I can't see how to manually add them to the list?

I think due to VLC not being on that list, I keep getting this error every time VLC launches and triggers the macro down below:

Does anyone know how to manually add apps to the automation permission list?

I've tried removing KM (app & engine) from the Accessibility Permission list and adding them when requested on restarting KM - but that has made no difference.

Thank you again everyone, I think / hope we are close to clinching this now....? :slight_smile:

You should have +/- buttons to add an App:

image

Thanks but that's not it (sorry, I didn't screengrab the full screen)

I mean the Automation settings:

21

You are showing the wrong section: "Automation".
You need to show/edit "Accessibility"

Hi SuperMario

I have been opening VLC full screen for awhile now and use the keystroke equivalent rather than choosing a menu by text, so I use Cmd + F.

34

Actually, I think the answer lies in the "Automation" section (as pointed out by peternlewis above).

While experimenting with / implementing APGH's suggestion, I received this request:

And now that KM has received automation control of System Events:

....everything seems to be working fine ie. the two macros below are so far working perfectly for VLC and IINA:

So firstly, a BIG THANK YOU to everyone above who helped me find a solution to this challenge!

But finally I guess, the question remains: how does one add applications manually to Automation control?