2018-01-09 06:53:49 +01:00
|
|
|
//
|
|
|
|
// SendToMicroBlogCommand.swift
|
|
|
|
// Evergreen
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 1/8/18.
|
|
|
|
// Copyright © 2018 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2018-01-09 07:10:56 +01:00
|
|
|
import Cocoa
|
2018-01-09 06:53:49 +01:00
|
|
|
|
|
|
|
// Not undoable.
|
|
|
|
|
2018-01-09 07:10:56 +01:00
|
|
|
final class SendToMicroBlogCommand: SendToCommand {
|
|
|
|
|
|
|
|
private let bundleID = "blog.micro.mac"
|
|
|
|
private var appExists = false
|
|
|
|
|
|
|
|
init() {
|
|
|
|
|
|
|
|
self.appExists = appExistsOnDisk(bundleID)
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(appDidBecomeActive(_:)), name: NSApplication.didBecomeActiveNotification, object: nil)
|
|
|
|
}
|
2018-01-09 06:53:49 +01:00
|
|
|
|
|
|
|
func canSendObject(_ object: Any?) -> Bool {
|
|
|
|
|
2018-01-09 07:10:56 +01:00
|
|
|
if !appExists {
|
|
|
|
return false
|
|
|
|
}
|
2018-01-09 06:53:49 +01:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func sendObject(_ object: Any?) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-01-09 07:10:56 +01:00
|
|
|
@objc func appDidBecomeActive(_ note: Notification) {
|
2018-01-09 06:53:49 +01:00
|
|
|
|
2018-01-09 07:10:56 +01:00
|
|
|
self.appExists = appExistsOnDisk(bundleID)
|
2018-01-09 06:53:49 +01:00
|
|
|
}
|
|
|
|
}
|
2018-01-09 07:10:56 +01:00
|
|
|
|
|
|
|
|