Meet Shortcuts for macOS

RSS for tag

Discuss the WWDC21 session Meet Shortcuts for macOS.

View Session

Posts under wwdc21-10232 tag

11 results found
Sort by:
Post not yet marked as solved
390 Views

Shortcuts Action with File parameter as input conflicts with Sandbox

Hi, I have developed a Shortcuts action for the new Shortcuts of macOS 12. I've created a custom intent and an Intents extension. My action receives one or more files as input. The file type has been set to a custom UTI com.adobe.pdf. However the files cannot be opened. I can see in the Console that Sandbox denies the access.  If I handle the intent directly in my main app with func application(_ application: NSApplication, handlerFor intent: INIntent) -> Any? I can only open files that have been opened by the main app before. If I handle the intent in an app extension I can't open any file at all. Both the main app and the extension are sandboxed with com.apple.security.files.user-selected.read-only set to 1. My app is singed with my valid developer ID. The example Shortcut workflow I've build simply receives PDFs as an input and is set-up to work as a Quick Action. But no matter which Shortcut configuration I choose, it does not seem to make a difference. Interestingly everything works as expected if I set com.apple.security.files.downloads.read-write to 1. Of cause that only works with the Downloads folder. My question: How do I have to configure my app and/or app extension in order to work with files that have been opened in Shortcuts and given to my Shortcut action as an input parameter. Cheers and thanks for your help
Asked
by Iomegan.
Last updated
.
Post not yet marked as solved
286 Views

Intents not showing up in Shortcuts app

I have an existing iOS app with shortcuts support, and I am trying to bring the same shortcuts to my Mac app in macOS Monterey. In my case, I have added the same intents definition file to my Mac target app, added "Intents eligible for in-app handling" to my Info.plust file and added the intent names, and made sure all the intent handling code is part of both iOS and Mac targets. Still, when I build and run the app on macOS Monterey, the new shortcuts don't show in the shortcut editor at all. I've tried closing and restarting the Shortcuts app, but no luck. The build logs do show the intents being built, but they're just not showing up in the Shortcuts app. I tried 'donating' one of the intents in my Mac app code, but got an error: Cannot donate interaction with intent that has no valid shortcut types Not sure what to try to make it work. Thanks.
Asked
by zulfishah.
Last updated
.
Post marked as solved
182 Views

Unable to Save Intents

Hi All, I'm using Core Data to store my data. I've followed the guide in the video but unable to complete the final steps. /// The core data stack `Data`     var dataProvider: datasProvider = .shared          func handle(intent: CreateNoteIntent, completion: @escaping (CreateNoteIntentResponse) -> Void) {         let title = intent.title!         let isBookmark = intent.isBookmark!         let photo = UIImage()                  let newIntent = Task { await self.dataProvider.addData(time: Date(), title: title, isFavorite: isBookmark as! Bool, image: photo) }                  let response = CreateNoteIntentResponse(code: .success, userActivity: nil)         response.noteIntent = newIntent //Error: Cannot assign value of type 'Task<(), Never>' to type 'Type'         completion(response)     } I'm using SwiftUI and it is for iOS app. Does anyone have a solution for this or can explain to me what went wrong please. Spent few hours figuring this out. Any help will be appreciated. Thank you.
Asked
by kaviraja.
Last updated
.
Post marked as solved
291 Views

Cannot find type 'CreateTaskIntentHandling' in scope

I’m trying to implement the code like shown in the session but problems start early — there seems to be no such thing like a CreateTaskIntentHandling class even after importing Intents. Cannot find type 'CreateTaskIntentHandling' in scope What am I missing here? masOS Monterey Version 12.0 Beta (21A5506j) Xcode Version 13.0 RC (13A233)
Asked
by mrtn.
Last updated
.
Post not yet marked as solved
349 Views

Sending file parameters to a Shortcut on Monterey programmatically?

I'm trying to run Shortcuts programmatically on Monterey. My understanding is that the official API for this is via AppleScript to the Shortcuts Events process. I created a Shortcut that does Quicklook on the passed in file parameter. It works as a Finder action but I can't figure out how to get it to work when running it via AppleScript or Scripting Bridge. If I send a file, alias or POSIX file, I get a generic Shortcuts error 4. If I send a path as a string, it just does a preview of the string passed in, and not the contents of the file the path references. Anyone have any insight on how to get this working?
Asked
by Mr_Noodle.
Last updated
.
Post not yet marked as solved
388 Views

Custom intent extension not supported on xcode Version 13.0 beta4?

Hi, I'm trying to integrate shortcuts into my app, I knew there are 2 ways to do that, 1. Via main app. 2. Use an intent extension. When I use method 1 after I add an intent definition file and create a custom intent then specify "Supported Intents" in main app target and write the logic code in appdelegate, every thing works smoothly. But When I turned to intent extension, after I create an intent extension, it seems extension target doesn't support to specify the intent. Then I fill the configuration in intent extension manually, then build my app. I think the log should print like it did when I use main app method but it didn't. So I wonder that s this means current beta4 sdk not support custom intent extension on MACOS or I missed something? Thanks.
Asked
by Zack_10.
Last updated
.
Post marked as solved
497 Views

Mac Siri Shortcut not working

Hello, Created one demo for creating task. But it does not work properly. When execute Shortcut from 2021-06-16 16:18:07.947665+0530 TestTask[28602:364855] [logging-persist] cannot open file at line 45068 of [d880193994] 2021-06-16 16:18:07.947700+0530 TestTask[28602:364855] [logging-persist] os_unix.c:45068: (0) open(/var/db/DetachedSignatures) - Undefined error: 0 Not sure, reason behind it
Asked Last updated
.
Post not yet marked as solved
312 Views

Creating shortcut actions with Catalyst

We are trying to create shortcut actions with Catalyst. Our app is already available on Mac, and we integrated the intents framework on iOS. So according to the WWDC21 "Meet Shortcuts on macOS" presentation, "it's likely that [we] have compiled out [our] Intents integration in the process of coming to Mac". The presentations suggests to "make sure to audit your code to re-enable this functionality when running on macOS Monterey." We have not found how to "re-enable this functionality". Any suggestion on how to create shortcut actions for Mac in this situation ?
Asked
by ffsfgghh.
Last updated
.
Post not yet marked as solved
443 Views

MacOS shortcuts don't work in the latest beta

MacOS 12.0 Beta (21A5268h) Xcode Version 13.0 beta (13A5155e) First of all, the video doesn't even mention that I have to add the intents I want to handle to the Info.plist in an "Intents eligible for in-app handling" array (or the corresponding setting in the general section) but I'm pretty sure that is also required. So I created a single create intent (for my existing app) with no inputs and an URL output just to test out that my code is getting called when I expect it. When I create a shortcut including my action and try to run it, I will get the following error: "Could not run Dummy Create" "There was a problem with the app." and I see the following messages in "Console.app": No plugins found to match query {     IntentsSupported =     (         DummyCreateIntent     );     "LS:ExtensionPlatforms" =     (         1,         6     );     NSExtensionContainingApp = "/path/to/xcode/build/dir/MyApp.app";     NSExtensionPointName = "com.apple.intents-ui-service"; } -[WFAction runWithInput:userInterface:runningDelegate:variableSource:workQueue:completionHandler:]_block_invoke Action <WFHandleCustomIntentAction: 0x126acc850, identifier: com.example.myapp.DummyCreateIntent, parameters: 1> finished with error {domain: WFIntentExecutorErrorDomain, code: 100}. Error Domain=WFIntentExecutorErrorDomain Code=100 "There was a problem with the app." UserInfo={NSUnderlyingError=0x126964230 {Error Domain=NSOSStatusErrorDomain Code=-600 "procNotFound: no eligible process with specified descriptor"}, NSLocalizedFailureReason=Could not run Dummy Create, NSLocalizedDescription=There was a problem with the app.} (and some other, less interesting messages) If I remove it from the supported intents then running the shortcut will just silently fail instead of showing the error (I have a show result action connected to my action's output) and the console.app will only show the first message and not the second one. (My app delegate method never gets called in either case) If I add a parameter (files and allowing multiple selection, and set a file in the workflow), I will also only get the first message in console app and the shortcut will get stuck at 25% completion. If it's not included in the supported intents, it will just silently fail again. (The app delegate method also doesn't get called in both cases)
Asked Last updated
.
Post not yet marked as solved
280 Views

Find is continuously prompting error

Hi! I installed CISCO VPN and installation was complete but after installation, finder started prompting an error and it's not even stopping! Its very frustrating to see! I was not expecting Microsoft kind of bug in apple. Please treat this urgently its getting bad!
Asked Last updated
.
Post marked as solved
636 Views

Shortcuts Events process isn't running - AppleScript fails

I'm trying to use the new Shortcuts for Mac scripting interface on the first Monterey beta. I'm having trouble running the example AppleScript shown in WWDC21 Meet Shortcuts For Mac (10232): tell application "Shortcuts Events" run the shortcut named "Dummy" end tell It doesn't seem to recognise a process called 'Shortcuts Events', and I get this error: The command-line utility works as expected in terminal.
Asked
by mralexhay.
Last updated
.