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?
Post
Replies
Boosts
Views
Activity
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?
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?
At what stage do you just abort a review and create a new submission?
I've run into a "not-so-stellar" reviewer on a rather minor update.
First it was rejected based on two grounds:
an allegedly non-working feature
meta data mentioning an allegedly pre-release feature
After pointing out the wrongly tested feature (left me speechless) and
providing public evidence of the feature not being pre-release,
the reviewer reverted to "in-review" to confirm the policy on the meta data.
It's now been a week. Since there is no way to communicate or poke anyone...
What's the best course of action?
Just abort the current review, and submit a new version in hope to get a better reviewer?
How do you deal with these kind of situations?
This is such a frustrating process.