gbammc / Thor

Switch the right application ASAP.
MIT License
1.17k stars 69 forks source link

能不能增加一个功能,设置快捷键是否可以隐藏窗口??? #9

Closed zhanggang807 closed 3 years ago

zhanggang807 commented 5 years ago

按两次快捷键 会显示 和隐藏,能不能不隐藏??

codeshif commented 4 years ago

这是切换啊,不是挺好的,你可以修改这段代码重新编译。

if let frontmostAppIdentifier = NSWorkspace.shared.frontmostApplication?.bundleIdentifier,
                    let targetAppIdentifier = Bundle(url: app.appBundleURL)?.bundleIdentifier,
                    frontmostAppIdentifier == targetAppIdentifier {
//  修改这里
                    NSRunningApplication.runningApplications(withBundleIdentifier: frontmostAppIdentifier).first?.hide()
                } else {
                    NSWorkspace.shared.launchApplication(app.appName)
                }