- Version: 2.6.1 (65)
- macOS: 10.13.4
I am currently using this app to toggle my apps: https://github.com/gbammc/Thor/
It's toggle code is simple: https://github.com/gbammc/Thor/blob/4f86a1768d33f7dbaf61182e2f10179a6166ec6a/Thor/ShortcutMonitor.swift#L17-L23
Now if I want to do the same with phoenix, after I call App.launch(name), I need to make another call to let the app focus, like this:
let app = App.launch('iTerm')
if (app) {
app.focus()
}
Per my feeling (because I have not a good way to measure), toggling with Thor is faster than using Phoenix script. I think it is due to they are calling different API. The difference might come from NSString *appPath = [sharedWorkspace fullPathForApplication:appName]; or the extra app.focus() call.
So, would it be okay to change the launch method (
|
+ (instancetype) launch:(NSString *)appName { |
) to simply calling
https://developer.apple.com/documentation/appkit/nsworkspace/1531434-launchapplication, or change the
options:NSWorkspaceLaunchWithoutActivation to default, so that
app.focus() can be avoided.
Or, maybe add a new method?
I am currently using this app to toggle my apps: https://github.com/gbammc/Thor/
It's toggle code is simple: https://github.com/gbammc/Thor/blob/4f86a1768d33f7dbaf61182e2f10179a6166ec6a/Thor/ShortcutMonitor.swift#L17-L23
Now if I want to do the same with phoenix, after I call App.launch(name), I need to make another call to let the app focus, like this:
Per my feeling (because I have not a good way to measure), toggling with Thor is faster than using Phoenix script. I think it is due to they are calling different API. The difference might come from
NSString *appPath = [sharedWorkspace fullPathForApplication:appName];or the extraapp.focus()call.So, would it be okay to change the launch method (
phoenix/Phoenix/PHApp.m
Line 44 in f02761e
https://developer.apple.com/documentation/appkit/nsworkspace/1531434-launchapplication, or change theoptions:NSWorkspaceLaunchWithoutActivationto default, so thatapp.focus()can be avoided.Or, maybe add a new method?