From 4b22514969141e1ef0e04e1a9bb1e3d5e5e9b9b9 Mon Sep 17 00:00:00 2001 From: Toxblh Date: Thu, 19 Apr 2018 16:23:27 +0100 Subject: [PATCH 1/2] v0.10 - added open preset, better work reload --- MTMR/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MTMR/Info.plist b/MTMR/Info.plist index 20be9f0..321e78e 100644 --- a/MTMR/Info.plist +++ b/MTMR/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9 + 0.10 CFBundleVersion 1 LSMinimumSystemVersion From fe07ea3b46529b7ce8fb4f7ad821d70247f094eb Mon Sep 17 00:00:00 2001 From: ad Date: Thu, 19 Apr 2018 18:53:29 +0300 Subject: [PATCH 2/2] * fixed deminiaturization and Finder opening --- MTMR/AppScrubberTouchBarItem.swift | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/MTMR/AppScrubberTouchBarItem.swift b/MTMR/AppScrubberTouchBarItem.swift index 50b652f..5f30481 100644 --- a/MTMR/AppScrubberTouchBarItem.swift +++ b/MTMR/AppScrubberTouchBarItem.swift @@ -92,20 +92,19 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem, NSScrubberDelegate, NSScrub } public func didFinishInteracting(with scrubber: NSScrubber) { - runningApplications[scrubber.selectedIndex].activate(options: [ .activateIgnoringOtherApps ]) +// runningApplications[scrubber.selectedIndex].activate(options: [ .activateIgnoringOtherApps ]) + + let bundleIdentifier = runningApplications[scrubber.selectedIndex].bundleIdentifier + if bundleIdentifier!.contains("file://") { + NSWorkspace.shared.openFile(bundleIdentifier!.replacingOccurrences(of: "file://", with: "")) + + } else { + NSWorkspace.shared.launchApplication(withBundleIdentifier: bundleIdentifier!, options: [.default], additionalEventParamDescriptor: nil, launchIdentifier: nil) + } // NB: if you can't open app which on another space, try to check mark // "When switching to an application, switch to a Space with open windows for the application" // in Mission control settings - - // TODO: deminiaturize app -// if let info = CGWindowListCopyWindowInfo(.optionOnScreenOnly, kCGNullWindowID) as? [[ String : Any]] { -// for dict in info { -// if dict["kCGWindowOwnerName"] as! String == runningApplications[scrubber.selectedIndex].localizedName { -// print(dict["kCGWindowNumber"], dict["kCGWindowOwnerName"]) -// } -// } -// } } }