Shortcuts

RSS for tag

Help users quickly accomplish tasks related to your app with their voice or with a tap with the Shortcuts API.

Shortcuts Documentation

Posts under Shortcuts tag

91 Posts
Sort by:
Post not yet marked as solved
3 Replies
887 Views
We donate our custom intents to SiriKit. Our intents have a couple parameters like: Start Foo in Boo The generic intent title is "Start Things". We need to show the specific title with params and not the generic title in Shortcuts. The problem is that the Shortcuts app does not distinguish our intents so we get tons and tons of "Start Things" suggestions for each different Foo, but each line in Shortcuts Add Action and Suggestions is simply "Start Things" for many pages over time as the user performs actions in our app. I have noticed some other apps are able to customize that title. Find My shows a title as "Show the location of SpecificiPadName". OpenTable shows "Get details for 'specific reservation name'". I have not been able to do the same kind of customization. In Xcode intent definition, the Shortcuts app and Suggestions section for the Intent does not seem to be related to the string used in the actual Shortcuts app. The generic title of the intent is always used in Shortcuts until you open the suggestion at which point you can customize the params. Either we need to disable suggestions altogether to avoid the user having pages of un-distinguished titles, or we need to customize the title to show its parameters. I note that even though we have 2 parameters, the "Key Parameter" menu in the Shortcuts app section of the Intent is disabled – I cannot select a parameter there. Also, the "Summary" in the Shortcuts app section is simply not what is shown in Shortcuts. Anyway, obviously there is some trick to this, but I have not been able to find it. Anyone have any insight into this?
Posted
by cypher.
Last updated
.
Post not yet marked as solved
0 Replies
189 Views
Can we assign any other value than 1, in the repeat index in shortcuts? In Automator, we are able to change the start number while doing any sequential operations.
Posted
by Danish297.
Last updated
.
Post not yet marked as solved
0 Replies
173 Views
Hi I love Shortcuts and Automation on iPhone. I would love to create an automation that allows Siri to say "Person X has texted you" when person X texts me on WhatsApp AND when I have a certain Focus active. Is this at all possible? Thanks for your help. Alexander Belgium
Posted Last updated
.
Post not yet marked as solved
0 Replies
596 Views
Hi all, am using the iPhone 13 pro and recently had a update to iOS 15.2.1 which has caused me not to be able to open 3rd party apps. All my apps are using the shortcuts feature. However even when using the search bar to open the original app without shortcut it doesn’t work. pls help :(
Posted
by Apt2119.
Last updated
.
Post marked as solved
4 Replies
1.4k Views
My app has a Siri Shortcut that works fine when I execute it from the Shortcuts app on my watch, but if I try to activate it by voice, Siri says: "Sorry, something's wrong. Please try again." and then a second later says "We've had a problem. Please try again." I'm currently on watchOS 8 beta 6. I last tested this in early July with beta 2 or beta 3 and it was working at that time. I haven't made any changes to the intent extension since then. The shortcut activates fine by voice on my phone, running iOS 15 beta 6. I'm also able to execute other Shortcuts by voice on my watch. Has anyone else run into this before? Is there a way to debug the intent extension on the watch, so I can see if any of my intent handler code is even being called?
Posted
by jasonmarr.
Last updated
.
Post not yet marked as solved
0 Replies
223 Views
I want just to make request action by clicking on app widget. I know that in iOS by clicking on app widget app is opened anyway. Only deeplinking is working. Question - maybe it's possible to open shortcut from widget using deeplinking this (below) or any different way? widgetURL(URL(string: "shortcuts://run-shortcut?name=[name]&input=[input])) Thanks for any help.
Posted Last updated
.
Post not yet marked as solved
1 Replies
319 Views
Menu("+") { Button("add") { print("add") } .keyboardShortcut("a", modifiers: [.command]) } The menu button not show keyboard shortcut label, and the shortcut function can not be used. I don't know if this is a bug or a function lack, obviously it not working as I expected. My environment: macOS Monterey 12.1 (21C52) XCode 13.1
Posted
by hui_huang.
Last updated
.
Post not yet marked as solved
0 Replies
276 Views
Good afternoon, Team - I would like guidance on how to create the following ShortCut: STEPS: Start Voice Memo on Apple Watch Initiate Theater Mode on Apple Watch Initiate Silent Mode on Apple Watch Thanks in advance for taking the time to look into this. Regards, Wilgen
Posted
by WDC3030.
Last updated
.
Post not yet marked as solved
0 Replies
420 Views
Hi there, I'm implementing a custom IntentHandler, which has a parameter. This parameter is an array of strings. I'd like to handle the case when user didn't specify the value for this parameter. I want to provide a value calculated using my business logic and ask the user to confirm that value. To do this, I use the resolveParameter function and return the following result: [INStringResolutionResult.confirmationRequired(with: someSuggestedValue)] Unfortunately, Siri throws an error with the message: "Uh oh, there's a problem. Please try again." using debug I caught the error, here's the error message: libc++abi: terminating with uncaught exception of type NSException Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected class Swift.__SwiftDeferredNSArray' terminating with uncaught exception of type NSException Here's a part of my code. func resolveParameter(for intent: MyCustomIntent) async -> [INStringResolutionResult] { if intent.arrayOfMyCustomParameters?.isEmpty ?? true { // Users did not specify the value intent.arrayOfMyCustomParameters = [someSuggestedValue] return [INStringResolutionResult.confirmationRequired(with: someSuggestedValue)] } else { var result = [INStringResolutionResult]()             for value in intent.arrayOfMyCustomParameters {                 result.append(.success(with: value))             }             return result } } p.s. This problem occurs only using the shortcut from the Siri voice assistant for iOS 15.0.0+ devices. Not sure if this is helpful, but here is the stack trace. libobjc.A.dylib`objc_exception_throw: -> 0x198f37670 <+0>: stp x28, x27, [sp, #-0x40]! 0x198f37674 <+4>: stp x22, x21, [sp, #0x10] 0x198f37678 <+8>: stp x20, x19, [sp, #0x20] 0x198f3767c <+12>: stp x29, x30, [sp, #0x30] 0x198f37680 <+16>: add x29, sp, #0x30 ; =0x30 0x198f37684 <+20>: sub sp, sp, #0xfc0 ; =0xfc0 0x198f37688 <+24>: mov x20, x0 0x198f3768c <+28>: mov w0, #0x20 0x198f37690 <+32>: bl 0x19902ea70 ; __cxa_allocate_exception 0x198f37694 <+36>: mov x19, x0 0x198f37698 <+40>: adrp x8, 372380 0x198f3769c <+44>: ldr x8, [x8, #0xb68] 0x198f376a0 <+48>: mov x0, x20 0x198f376a4 <+52>: blr x8 0x198f376a8 <+56>: mov x20, x0 0x198f376ac <+60>: adrp x8, 13442 0x198f376b0 <+64>: add x1, x8, #0x959 ; =0x959 0x198f376b4 <+68>: bl 0x198f24040 ; objc_msgSend 0x198f376b8 <+72>: str x20, [x19] 0x198f376bc <+76>: adrp x8, 342105 0x198f376c0 <+80>: add x8, x8, #0x78 ; =0x78 0x198f376c4 <+84>: add x8, x8, #0x10 ; =0x10 0x198f376c8 <+88>: mov x21, x19 0x198f376cc <+92>: str x8, [x21, #0x8]! 0x198f376d0 <+96>: mov x0, x20 0x198f376d4 <+100>: bl 0x198f37270 ; object_getClassName 0x198f376d8 <+104>: str x0, [x19, #0x10] 0x198f376dc <+108>: cbnz x20, 0x198f376e8 ; <+120> 0x198f376e0 <+112>: mov x8, #0x0 0x198f376e4 <+116>: b 0x198f376f4 ; <+132> 0x198f376e8 <+120>: tbnz x20, #0x3f, 0x198f3779c ; <+300> 0x198f376ec <+124>: ldr x8, [x20] 0x198f376f0 <+128>: and x8, x8, #0xffffffff8 0x198f376f4 <+132>: str x8, [x19, #0x18] 0x198f376f8 <+136>: adrp x22, 377914 0x198f376fc <+140>: ldrb w8, [x22, #0x2c6] 0x198f37700 <+144>: cbz w8, 0x198f37720 ; <+176> 0x198f37704 <+148>: mov x0, x20 0x198f37708 <+152>: bl 0x198f37270 ; object_getClassName 0x198f3770c <+156>: stp x20, x0, [sp, #0x8] 0x198f37710 <+160>: str x19, [sp] 0x198f37714 <+164>: adrp x0, 28 0x198f37718 <+168>: add x0, x0, #0xae9 ; =0xae9 0x198f3771c <+172>: bl 0x198f4957c ; _objc_inform 0x198f37720 <+176>: adrp x8, 377914 0x198f37724 <+180>: ldrb w8, [x8, #0x2c7] 0x198f37728 <+184>: cbz w8, 0x198f37780 ; <+272> 0x198f3772c <+188>: ldrb w8, [x22, #0x2c6] 0x198f37730 <+192>: cbnz w8, 0x198f37750 ; <+224> 0x198f37734 <+196>: mov x0, x20 0x198f37738 <+200>: bl 0x198f37270 ; object_getClassName 0x198f3773c <+204>: stp x20, x0, [sp, #0x8] 0x198f37740 <+208>: str x19, [sp] 0x198f37744 <+212>: adrp x0, 28 0x198f37748 <+216>: add x0, x0, #0xae9 ; =0xae9 0x198f3774c <+220>: bl 0x198f4957c ; _objc_inform 0x198f37750 <+224>: add x0, sp, #0x20 ; =0x20 0x198f37754 <+228>: mov w1, #0x1f4 0x198f37758 <+232>: bl 0x1941a3b34 0x198f3775c <+236>: mov x22, x0 0x198f37760 <+240>: adrp x8, 342104 0x198f37764 <+244>: ldr x8, [x8, #0xd18] 0x198f37768 <+248>: ldr x0, [x8] 0x198f3776c <+252>: bl 0x1941a3df8 0x198f37770 <+256>: mov x2, x0 0x198f37774 <+260>: add x0, sp, #0x20 ; =0x20 0x198f37778 <+264>: mov x1, x22 0x198f3777c <+268>: bl 0x198f4a8cc ; symbol stub for: backtrace_symbols_fd 0x198f37780 <+272>: mov x0, x20 0x198f37784 <+276>: nop 0x198f37788 <+280>: adrp x2, 3 0x198f3778c <+284>: add x2, x2, #0xac0 ; =0xac0 0x198f37790 <+288>: mov x0, x19 0x198f37794 <+292>: mov x1, x21 0x198f37798 <+296>: bl 0x198f4a7d0 ; symbol stub for: __cxa_throw 0x198f3779c <+300>: adrp x8, 372380 0x198f377a0 <+304>: add x8, x8, #0xae0 ; =0xae0 0x198f377a4 <+308>: and x9, x20, #0x7 0x198f377a8 <+312>: ldr x8, [x8, x9, lsl #3] 0x198f377ac <+316>: adrp x9, 372380 0x198f377b0 <+320>: add x9, x9, #0x258 ; =0x258 0x198f377b4 <+324>: cmp x8, x9 0x198f377b8 <+328>: b.ne 0x198f376f4 ; <+132> 0x198f377bc <+332>: ubfx x8, x20, #55, #8 0x198f377c0 <+336>: adrp x9, 372380 0x198f377c4 <+340>: add x9, x9, #0x2e0 ; =0x2e0 0x198f377c8 <+344>: ldr x8, [x9, x8, lsl #3] 0x198f377cc <+348>: b 0x198f376f4 ; <+132> 0x198f377d0 <+352>: udf #0x0 0x198f377d4 <+356>: udf #0x0
Posted
by azemtsov.
Last updated
.
Post not yet marked as solved
9 Replies
7.7k Views
I would love to see more integration between HomeKit and Siri Shortcuts - a common request I get for my app, Home Flash for HomeKit, is to flash a light when motion is detected, or a button is pressed, but it's not possible today. I could envision this being implemented in one of two ways: Allow a scene to execute a Siri Intent, so an 'Intruder' scene could turn on my porch light, and trigger a Siri Intent either on my phone or Apple TV to flash my bedroom or office light. This is my preferred way, since as a 3rd party developer, I have the ability to create Scene's for my users. Add more flexibility to HomeKit Automations that are Converted to Shortcuts, so that I could direct my users in how to do this
Posted
by Mcorey.
Last updated
.
Post not yet marked as solved
1 Replies
399 Views
I'm trying to add support for Shortcuts to my Mac app. I followed the steps here: https://developer.apple.com/documentation/sirikit/adding_user_interactivity_with_siri_shortcuts_and_the_shortcuts_app?language=objc but my app does not show up in Shortcuts. In addition to those steps, I also added my intent to (main app target) > General > Supported Intents. This had no effect. I believe that I don't need to create a separate intents extension for mac as you would on iOS. I tried that as well, but it still didn't show up in Shortcuts. This is a pure AppKit app, not iOS, not Catalyst. Is there a magic Info.plist key I'm missing? This problem is frustrating because there doesn't seem to be any way to analyze it. If you want to see what I've done it's at https://github.com/gnachman/iterm2.git in these branches: intents_extension main_app_intent
Posted
by gnachman.
Last updated
.
Post not yet marked as solved
6 Replies
775 Views
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
Posted
by Iomegan.
Last updated
.
Post not yet marked as solved
1 Replies
525 Views
Hi everyone, Firstly, I want to point out that I am new to coding and I am French, so please excuse me for the mistakes. I try to use Apple Shortcuts with the Readwise API to send more easily things into my Readwise workspace. I have my Readwise Token, the Readwise URL but I can't connect the shortcuts with readwise with the JSON objects. In the JSON part, first I choose "Dictionary" with the key "highlights" and I add an item "Array" to put the key "text" as stated on the Readwise API site. But I always have an error "expected a list of items but got type dict". I tried various combinations but I can't reach my goal. Someone can help me ? Thanks, Golgoth.
Posted
by golgoth.
Last updated
.
Post not yet marked as solved
0 Replies
308 Views
Using Spotlight, the currently available shortcuts of the Shortcuts app can be displayed and opened/started under macOS 12. Since I would like to display a list of available shortcuts in my application, I wonder how this could be realized. Using NSMetadataQuery and the corresponding NSPredicate Spotlight can be accessed and searched. Files, directories and various other information can be requested from Spotlight this way, but I can't find a suitable search filter to give me the available shortcuts. Does anyone here have any ideas?
Posted
by gkoeder.
Last updated
.
Post not yet marked as solved
0 Replies
238 Views
I'm trying to create a shortcut that seeks forward or backward 5 seconds on media (musics and videos). However, when I try to run this action, it doesn't work in configurations related on picture 1. I've realized it works out if I set configuration to seek a specific time, as related on pic 2
Posted
by samuelsco.
Last updated
.
Post not yet marked as solved
0 Replies
207 Views
Hi, I'm stuck with my iOS shortcut. What I need to do is to create a loop that repeats while the user keeps adding data and for a maximum of 10 times. In every iteration, it asks the user to input text and stores it in a different variable. This is what I've tried, but definitely, it doesn't work. It stores every Provided Input in the same variable list. 0 Set variable ExitLoop to Number 10 Repeat Number If ExitLoop is 0 Ask for Text with Item Repeat Index If Provided Input is text 1 Set variable ExitLoop to Number Otherwise Add Provided Input to List End If Otherwise End If End Repeat Any help? Thanks, Dani
Posted
by Danval31.
Last updated
.
Post marked as solved
1 Replies
378 Views
Hi, My Mac app saves it's local database and other important information in the Application Support directory. I want to now create an Intents extension for the app so I can create shortcut actions. When I currently run this, the Application Support directory for the extension is different than for the main application. Is there any way on macOS for the extension to access it's parent applications App Support directory? I know it's not possible in iOS, and you have to use App Groups for this, but I'm wondering about the Mac. BTW, the app is a sandboxed app for the Mac App Store.
Posted
by zulfishah.
Last updated
.
Post not yet marked as solved
1 Replies
380 Views
Hi, I have an app that provides Shortcut actions. One of these actions can take as input an array of String, so I checked the "Supports multiple values" checkbox in Intents definition. Since iOS 15, I have this strange behaviour when creating a new Shortcut: if the action is the first to be added, I can add new strings as I want. if there is a node present before and the array is empty, then adding a string will crash the Shortcut app. (if there is a node present and the array is not empty, then I can add new strings, and even remove all the strings I added before and replace them) Running the Intents through Xcode debugger tells me the crash appens when initializing a multiple value parameter: 2021-10-16 09:26:37.209264+0200 Shortcuts[2431:41261] *** Assertion failure in -[WFMultipleValueParameterState initWithValue:], WFVariableSubstitutableParameterState.m:49 2021-10-16 09:26:37.209968+0200 Shortcuts[2431:41261] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: value' Am I the only one experiencing this? (a quick search through the forum says yes) How can I fix it?
Posted Last updated
.
Post not yet marked as solved
0 Replies
253 Views
I'm facing this issue the app I'm working on, everything works fine besides this little weird behavior. When I run the completion on my intent handler with any failure, custom or not, Siri repeats the error twice and then finishes with "Done" or "That's done" or "Ok". I checked if the completion was being called multiple times but that was not the case. Then I downloaded the Soup Chef example app, provided by apple, and changed the handler just to immediately run the completion with the .failureOutOfStock error and observed a similar behavior. I would post the short video I made or link to it here but it seems I'm not able to do so. If anyone wants to see I uploaded it on Streamable, /f73ujr. This was building on Xcode 12.5.1, running on an iOS 14.6 device. I didn't find anything about this behavior anywhere, does anyone know anything about it?
Posted
by adrntoken.
Last updated
.