Starting programs with os.start doesn't has focus
I've written a custom remote where I want to launch some programs in my windows system... Looking at others remote it seem that the right way is to use os.start...
The strange behavior is that most of the time this software doesn't have focus after start.
I've also try to implement some sort of action.switch (like others in bundle remotes with win.switchtowait("foobar2000.exe");) but I wasn't able to give to the app the focus and have it top of other windows! I'm on Windows 10.
I've also noticed that the standard Chrome remote have this issue... If I launch Chrome but other programs is opened chrome it is not the focused and first visible app.
More strange is that if I use my action.switch before a keyboard command, like my toggle_fullscreen actions it seem to work.
Have no one this problems?
This is a portion of my code.
[email protected] Start Foobar actions.start_foobar2000 = function () os.start("C:\\DATA\\PortableApps\\foobar2000\\foobar2000.exe"); end [email protected] Start Kodi actions.start_kodi = function () os.start("C:\\Program Files (x86)\\Kodi\\kodi.exe"); end [email protected] Start Amazon Prime actions.start_primevideo = function () os.start("chrome", "--start-fullscreen", "--app=https://www.primevideo.com/"); end [email protected] Toggle fullscreen actions.toggle_fullscreen = function () actions.switch() keyboard.stroke("f11"); end
Yes, the "focus" function is missing when I try to launch an image viewer on the second screen connected to PC.
I use Dual Monitor Tools software to move focused application to the second screen.
[email protected] start viewer
actions.start_viewer = function ()
@wol --- wakes PC on LAN
os.start("D:\path\viewer.exe"); --- starts the image viewer
FOCUS function = missing to operate the opened application
keyboard.stroke('ctrl','1"); ---- Dual Monitor Tools moves the focused app to the second screen
Without focus the remote is useless, because a random application (or none) is moved to the second screen. Can anyone advice?