Post not yet marked as solved
To support Continuity Camera I am creating a special NSMenuItem with
item.identifier = NSMenuItem.importFromDeviceIdentifier
When the menu is selected I would suspect the event to trigger Continuity Camera and then provide the data via responder chain to the NSViewController
class MainViewController : NSViewController {
override func validRequestor(forSendType sendType: NSPasteboard.PasteboardType?, returnType: NSPasteboard.PasteboardType?) -> Any? {
print("validRequestor")
if let pasteboardType = returnType, NSImage.imageTypes.contains(pasteboardType.rawValue) {
return self
} else {
return super.validRequestor(forSendType: sendType, returnType: returnType)
}
}
But given that this is not triggering anything I am wondering what I might be missing.
Any pointers?
Post not yet marked as solved
Is it possible to somehow install an older version from the Mac App Store?
We got a new release out. It has bug and I want to quickly allow the customer to test it and solve his pain of a non-working version.
Ideally I would just tell him "install the old version while we fix it" - but there doesn't seem to be a way to install the old version. Wasn't there at some stage?
I could add him as external tester - but that needs a review loop. Why oh why?
Adding him as internal tester doesn't seem right either. He is not "internal".
I am really worried about the options here. This is painful.
What's the best way to deal with this?
Post not yet marked as solved
I've taken the code from the WWDC video and are trying to run a shortcut via ScriptingBridge:
import ScriptingBridge
@objc protocol ShortcutsEvents {
@objc optional var shortcuts: SBElementArray { get }
}
@objc protocol Shortcut {
@objc optional var name: String { get }
@objc optional func run(withInput: Any?) -> Any?
}
extension SBApplication: ShortcutsEvents {}
extension SBObject: Shortcut {}
and
guard
let app: ShortcutsEvents = SBApplication(bundleIdentifier: "com.apple.shortcuts.events"),
let shortcuts = app.shortcuts else { throw "error" }
print("getting short")
guard let shortcut = shortcuts.object(withName: shortcutName) as? Shortcut else { throw "error" }
print("running short", shortcut)
let res = shortcut.run?(withInput: input)
print("shotcut result", res ?? "nil")
While I am getting the shortcut object just fine
running short <SBObject @0x6000035c8e40: <class 'srct'> "append" of application "Shortcuts Events" (16450)>
running it, just does nothing and returns nil
shotcut result nil
Running the shortcut via cli works as expected.
I (hopefully) have set the entitlements correctly
but I am feeling a little stumped not to even get an error at all.
What am I doing wrong there?