Problem using Application Focus

Hi I’m trying out the trial version with the intention of buying. I have come across a problem with sending a midi ‘note on’ to bring an all ready running application to the front (ie application focus.
The log window states that it cannot find the app.
The app in question is a Microsoft Store app called SongbookPro and therefore I do not have its exact path and name as its is in the WindowsApps folder which is not accessible.
To put this in context I am using SongbookPro to show Lyrics of songs and am running Ableton Live for the backing music. Ableton is sending a midi note to Midi translator in order to advance the lyrics in SongbookPro. Midi translator is receiving the midi but then cannot find the app.

I have this working with an application called MidiKey2Key plus there utility called Bring to Front. However I need to send 2 midi notes in quick succession to bring SongbookPro into focus and then scroll the lyrics. I feel that Midi Translator could be a more elegant way of doing this and it has a much greater range of other translation options.
Hope someone can help with this.
Phil

Hi and welcome to the Bome Community!

Yes, it appears that since this is a Windows App and not a regular application. The Application is located in the C:\ProgramFiles\WindowsApps folder which doesn’t have permissions for the normal user.

I’m not sure if there is anything you can do about it. I don’t believe Windows Apps are fully supported for Application Focus, but will check further on this.

I also tried doing injected keystrokes, but apparently the SongBook Pro application does not support injected keystroke events either.

In the meantime, if you have a general area on the screen that your SongBook Pro application is on, you could execute a outgoing mouse click in that area followed by the desired keystroke. See attached project file.

SongPro-Click-and-Scroll-2022-02-17.bmtp (1.7 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi Many thanks for your very quick and informative reply - really appreciate it. Will try your suggestion first thing tomorrow and hope it works Ok.
Impressed with the response so will be buying the full version tomorrow even if I have to wait for future developments, interesting that the big app from MidiKey2key is able to access the Windows app ok.

Thanks again
Phil

Hey, thanks for your purchase and the good words!

You might be able to supplement MT Pro with a small AutoHotKey script that can provide application focus. I haven’t played with that, however. Basically to focus you would call the script and the script might be able to use it’s language to provide focus. I’m not 100% sure though because AutoHotKey I believe was written before the Microsoft App Store foundation stuff. It really probably depends on how much effort they put into keeping it up-to-date with the latest Windows implementation.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi
Now purchased MidiTranslator.
Further to our previous posts and for general interest.
Your SongPro click and scroll project worked fine when using my midi hardware controller.
However when sending a midi note from Ableton Live nothing happens - Unless - you take the focus away from Ableton before sending the midi note ie place midi note at the end of a clip say 2 bars long; start the clip then click elsewhere on the screen to take the focus away from Ableton.
Another solution which works is to use the exe file btf64.exe (available here [BringToFront v1.0 (midikey2key.de)] ) [https://midikey2key.de/getfile.php?file=26] as the Outgoing Execuctive file with the parameter “SongbookPro”. This gives SongbookPro the focus and then send the keystroke.
thanks
Phil

Yes, interesting. We will look further into why this MS App store does not allow setting focus. Thanks for posting!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

The below AutoHotKey Script in conjunction with MT Pro can activate SongBookPro.
You can copy and paste into a text editor and then name the file to create it or use this attachment. Rename it from .txt to .ahk

Songbook.txt (442 Bytes)

/*
Title: Focus Application Songbook Pro
Description: Based on Title Match
AutoHotKey_L Version: 1.1.09.00
Written by: Steven J. Caldwell
Last Update: 2022-02-18
Other Notes:
*/
IfWinExist ,SongbookPro
	{
	; msgbox, Songbook Exists
	WinActivate , SongbookPro
	WinWaitActive ,SongbookPro,,5
	If ErrorLevel
		{
		msgbox SongbookPro cannot activate"
		ExitApp
		}
	
	}
Else
	msgbox, SongbookPro Does Not Exist

ExitApp


Here is the project file.

SongPro-Activate-and-Scroll-2022-02-18.bmtp (1.4 KB)

On my System, the outgoing action looks like this. It will changed depending on where you put the script on your system.
image

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Many thanks for the script etc.
All is working fine now.
Auto hot keys seems like a very useful app.
Really appreciate your help.
Phil

Glad to help!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz