2018-01-09 06:53:49 +01:00
|
|
|
//
|
|
|
|
// SendToCommand.swift
|
|
|
|
// Evergreen
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 1/8/18.
|
|
|
|
// Copyright © 2018 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
2018-01-10 07:04:45 +01:00
|
|
|
// Unlike UndoableCommand commands, you instantiate one of each of these and reuse them.
|
|
|
|
|
2018-01-09 06:53:49 +01:00
|
|
|
protocol SendToCommand {
|
|
|
|
|
2018-01-10 07:04:45 +01:00
|
|
|
func canSendObject(_ object: Any?, selectedText: String?) -> Bool
|
|
|
|
func sendObject(_ object: Any?, selectedText: String?)
|
2018-01-09 06:53:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
extension SendToCommand {
|
|
|
|
|
|
|
|
func appExistsOnDisk(_ bundleIdentifier: String) -> Bool {
|
|
|
|
|
|
|
|
if let _ = NSWorkspace.shared.absolutePathForApplication(withBundleIdentifier: bundleIdentifier) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|