After selecting that command, SublimeText window remains active and the link is opened in the Chrome browser being in the background.
Same happens with extensions like DevDocs, Clickable URLs, etc.
Open in Browser command doesn't focus the Browser
i’m trying to solve this issue with help of “run_multiple_commands” and ctypes.windll.user32.SetForegroundWindow
e.g.
{ "keys": "f1"],
"command": "run_multiple_commands",
"args": { "commands":
{"command": "single_selection", "context": "window"},
{"command": "find_under_expand", "context": "window"},
{"command": "dev_docs_search_selection", "context": "window"},
{"command": "partial(ctypes.windll.user32.SetForegroundWindow, ctypes.windll.user32.?????, 0)", "context": "window"}
]}
}
yet i am not sure that it’s allowed to use partial() in commands args and don’t know how to get hwnd of the browser that is opened the link/html.
Help from a python win32 module expert is badly needed, any help appreciated
Hopefully that issue can be fixed soon
Just tested with Firefox, same thing, SublimeText remains in focus
Tested with ST3 Build 3059 and 3061, Win8.1 x64
Assuming you are using the run_multiple_commands from File change detection, you cannot execute an arbitrary command like that with the plugin. The command entry is a command within ST.
As a side note, there is a bug with how that sample finds the view context, though it doesn’t directly apply to your situation. I had fixed it and put it on github (link), with the intention of improving the macro functionality. But I haven’t worked on it in a while, or found a good way to do record macros.