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

109 Posts
Sort by:
Post not yet marked as solved
2 Replies
72 Views
Currently I am trying to create some shortcuts for my iOS 17 app. The AppIntent looks like this: class PostClass{ public init() { let url = URL(string: "http://myurl")! var request = URLRequest(url: url) request.httpMethod = "POST" struct Message: Encodable { let device_type: String } let message = Message( device_type: "device" ) let data = try! JSONEncoder().encode(message) request.httpBody = data request.setValue( "application/json", forHTTPHeaderField: "Content-Type" ) self.request = request } } var activateDevice = PostClass() @available(iOS 17, *) struct ActivateIntent: AppIntent { static let title: LocalizedStringResource = "Activate" func perform() async throws -> some IntentResult { let task = URLSession.shared.dataTask(with: activateDevice.request) { data, response, error in let statusCode = (response as! HTTPURLResponse).statusCode if statusCode == 200 { print("SUCCESS") } else { print("FAILURE") } } task.resume() return .result() } } Unfortunately, the shortcut throws an error after every second execution. I looked into the ips-file and saw the following traceback: Thread 2 Crashed: 0 Runner 0x1028ddd30 closure #1 in ActivateIntent.perform() + 388 1 CFNetwork 0x1a6f39248 0x1a6f2a000 + 62024 2 CFNetwork 0x1a6f57210 0x1a6f2a000 + 184848 3 libdispatch.dylib 0x1adced13c _dispatch_call_block_and_release + 32 4 libdispatch.dylib 0x1adceedd4 _dispatch_client_callout + 20 5 libdispatch.dylib 0x1adcf6400 _dispatch_lane_serial_drain + 748 6 libdispatch.dylib 0x1adcf6f64 _dispatch_lane_invoke + 432 7 libdispatch.dylib 0x1add01cb4 _dispatch_root_queue_drain_deferred_wlh + 288 8 libdispatch.dylib 0x1add01528 _dispatch_workloop_worker_thread + 404 9 libsystem_pthread.dylib 0x201dd4f20 _pthread_wqthread + 288 10 libsystem_pthread.dylib 0x201dd4fc0 start_wqthread + 8 Is there any way to locate the error with these information? Has it something to do with the fact that my code is not thread-safe? Or is there any internal bug? Grateful for any help, thanks in advance!
Posted
by alex_hsv.
Last updated
.
Post not yet marked as solved
5 Replies
457 Views
I have several AppEnum in my app and I can no longer succesfully get a value using requestValue / requestDisambiguation methods in when running an AppIntent. They all stopped working in iOS 17.4; The list of cases does show to the user but uppon selection it throws the following error: AppIntents.PerformIntentError.unsupportedValueType
Posted Last updated
.
Post marked as solved
1 Replies
98 Views
I'm currently exploring how to implement the AppIntent parameter with a list of apps similar to what's shown in the screenshots provided below: I'm particularly interested in how the searchable list of apps is implemented. My current approach involves creating an enum for the apps, but it lacks searchability and requires manual addition of each app. Does anyone have an idea on how this functionality might be implemented? It appears that the searchable list might be a native Apple view, but I haven't been able to find any documentation or resources on it. Any insights or pointers would be greatly appreciated!
Posted Last updated
.
Post not yet marked as solved
1 Replies
88 Views
Creating AppEntity objects for use as AppIntents to do filtering no longer works in iOS 17.4. If you have a prior shortcut setup that does that, then it will work. It seems some apps still work, but mostly i see the app shortcut action no longer has the Filtering options.
Posted Last updated
.
Post not yet marked as solved
0 Replies
100 Views
On macOS Sonoma (not tested with other systems) there is a bug when you have the home folder on a separate volume and you use the shortcuts apps to generate standalone programs that you can add to the dock. I found out why : those shortcuts are generated inside the Application folder that is in the home directory but when the whole home directory is not on the same volume as the system itself then you're greeted with a permission issue message. The workaround is to make a symbolic link between "external volume/home/Applications" and "main volume/home/Applications" to trick the shortcuts app into generating those standalone apps. Would be great to have this fixed.
Posted Last updated
.
Post not yet marked as solved
0 Replies
145 Views
I would like to request the ability to group windows in mission control so that I can easily swap all windows between my 2 external monitors easily. Anyway to make swapping all windows between the displays easier would be a huge time saver. Making this an option in shortcuts would work as well.
Posted
by deans4.
Last updated
.
Post not yet marked as solved
0 Replies
220 Views
I am working on an application design where I would like to have the Iphone running an app such as Apple Map, and while I might be driving in the car I would like to have my apple Watch invoke a screen shot of the current view of I map showing my location without having to use the iphone. So the Iphone would be active and in a car holder displaying my location on the map. Once I made my route point, such as a waypoint. I would like to press a button on my watch app to do a screen print. Second though is, could I press a button on my Apple Watch app to fire an request to my own IOS Application using WatchConnectivity to capture my Location to a data file. Third thought is could a press a button on my Apple Watch app to interact with an active app, which is an app like a reminder app and create a new Reminder Note in the active app in focus on my Iphone, but is not a component of my IPhone App. Thanks for any insight how I could make a Apple Watch app send Button Presses reliably to my Iphone Application active, so that I. could avoid having to touch my iPhone? Thanks in advance for any guidance.
Posted
by bxw0405.
Last updated
.
Post not yet marked as solved
2 Replies
173 Views
My requirement is to execute this shortcut on the Apple Watch, where I input speech, and it's converted into text to be saved in the memo app. However, the shortcut doesn't function correctly on the Apple Watch, and I can't sync the content to the memo app. Suspecting an issue with synchronization, I added the current time along with my voice input, only to find that while the current time gets transferred, the text does not. I wondered if the problem was with voice input, so I tried switching to keyboard input, but the outcome remained unchanged. I have tested this issue on multiple Apple Watches and found the problem persists across all devices. Both my phone and iWatch are updated to the latest system versions. https://www.icloud.com/shortcuts/d58d14627dbe450ead5e9217e1a68c27
Posted
by jin_asac.
Last updated
.
Post not yet marked as solved
4 Replies
979 Views
Hi, not sure if this forum is the right place to ask, but it’s extremely difficult to search the web for answers about shortcuts.app (must be the name…). I’m learning python currently and I’m trying to automate recurring tasks on my Mac easily. I have a python script as a first test-case that works (It basically makes a bunch of named folders). I use Apples Shortcuts.app to execute the python-file with the shell-script action. I start this script in Finder from the Quick Actions menu. The script creates my folders, but not in the selected folder when executing it, but always in my users home folder /Users/markus/. I suspect I have to somehow tell the Shortcut to take the currently selected folder as a variable or something. I tried to read the help but I don’t find anything useful and don’t understand the options of the Shell-Script Action in Shortcuts.app. Any ideas how I can get this to work? Or does anyone have a link to a good forum to ask questions about Shortcuts.app and automation? Thanks! Regards Markus
Posted
by M_Ceh.
Last updated
.
Post marked as solved
1 Replies
160 Views
Hi, Anyone can tell me where is stored the customized shortcut for dictation on macOS Sonoma? By mistake I customize one shortcut (it stores always the last one) and I want to restore the default shortcut dropdown list. From the image I want to delete "Command+F" and restore the dropdown list. Thank you. Regards FA
Posted
by qanon.
Last updated
.
Post not yet marked as solved
1 Replies
148 Views
The app's password conditions are not functioning properly. Upon entering the wrong password, the app still allows access. Additionally, when prompted for input upon opening the app, clicking the cancel button allows access without requiring the [password.
Posted Last updated
.
Post not yet marked as solved
0 Replies
235 Views
Hi, I would like to make a shortcut enter a keyboard short, CMD+m to be precise. Note that I dont want to run the shortcut when pressing CMD+m. The shortcut should press CMD+m, if that makes sense. Is javascript an option? How would the code look like?
Posted
by Stahlblau.
Last updated
.
Post not yet marked as solved
0 Replies
282 Views
I have a problem with shortcuts. I try to build a shortcut for recognizing some words and numbers in JPEG files. I noticed that if I select all the text in Preview app some words can be found that Shortcuts text extraction command cannot return. do you know if his is normal? Is it possible to use preview extraction in shortcuts ? Thanks
Posted
by cloum.
Last updated
.
Post not yet marked as solved
0 Replies
170 Views
hello I'm almost finished creating the app but I'm just missing one feature. This is that when the user installs the installation when he opens application A it immediately redirects him to application B which will be mine on a specific page. Can you tell me how I can do this? There is an application that does exactly the same thing, it's 'one sec' my application is identical
Posted Last updated
.
Post not yet marked as solved
0 Replies
207 Views
My app has an AppIntent that returns a collection of AppEntity items. Using a shortcut with the repeat with each action to loop the entities, it prompts me multiple times to allow to share the entities (I select "Always Allow" on the first one, but it keeps asking over and over). All the prompts after the first one, shows an incorrect note saying something like: "Previously this shortcut was allowed to share 1 item with …" the count of items shared is always wrong, for example, if I initially selected "Always Allow" for 10 entities on the first prompt, the second says previously 1 item, the third prompt actually has the count right, saying 10 items, and then a fourth prompt (seems to be the last one) says something like 40 items Some more facts: This issue does not happen for example when I fetch entities from a system based intent, like get calendar events. It correctly only prompt for my permission once My app is already on the app store
Posted Last updated
.
Post not yet marked as solved
0 Replies
268 Views
I have an Intents definition file for a Custom Intent that I want to convert to an AppIntent. The Custom Intent has the checkbox "Configurable in Shortcuts" not checked and therefore the "Convert to App Intent" Button is greyed out. I can however still do a conversion using the Menu-Item "Editor"->"Convert to App Intent". The intent has a number of parameters that are not configurable, but were set in code. This way it was possible to donate shortcuts with the parameters (and even the title) set in code. The automatic conversion using the menu item however produces a result that does not match the legacy Custom Intent (Parameters appear in the Shortcuts App etc). I also did not find any way to create AppIntents that have parameters that can be set in code, before the intent is donated. I would leave the old legacy Custom Intents as they are, but as soon as make use of any of the new iOS 16 Shortcut features (App Shortcuts) the existing donated Custom Intents disappear in the Shortcuts App. Given the apparent inability to convert them into AppIntents due to the missing code-set parameters, I would be happy for any advice on potential solutions.
Posted
by hhtouch.
Last updated
.
Post not yet marked as solved
0 Replies
160 Views
Hello, I wanted to create a shortcut in the Shortcuts app, which includes QuickTime's Screen recording, however I only see the Screenshot option (screen photo) there. Is there any way (maybe using AppleScript) to include Screen recording (only defined area, not the entire screen) in the Shortcuts app, so I can do furter edits to the given video? Thank you for your help.
Posted
by matthires.
Last updated
.
Post not yet marked as solved
0 Replies
224 Views
Adding the AppIntent of my app as AppShortcuts to the Shortcuts Apps was easy. This only required an AppShortcutsProvider. However, I am confused how the AppShortcuts are shown in the Shortcuts App. It seems that there are different styles enter image The AppShortcuts of some apps are shown as tiles While shortcuts from other apps are shown as collection of circle icons Some "circle collection" use a default gray background with blue icons Others color or even gradient backgrounds with white icons The only thing I found that might be related to the design is the shortcutTileColor property in the AppShortcutsProvider. However using/changing this property has no effect on how my app's shortcus are shown: On the default gray background / blue icon. Among the different apps on my devices I cannot see any logic which shortcuts are shown as tiles and which as circle icons. Additionally third party apps use colored background or gradients. So there there has to be a way to change this. But how?
Posted
by Agenor.
Last updated
.
Post not yet marked as solved
0 Replies
225 Views
AppIntens can be used as actions when working with Shortcut Automation. iOS offers a bunch of different triggers to start an automation, such as "Time of Day", "Email", "Transaction", etc. Depending on the trigger one can then pass different "Shortcut input" values as parameters to the App Intent. While in many cases the expected type is quite obvious, this is not always the case. An Email type input for example offers Subject, Sender, Recipients, Attachments, Content, Name. Subject will be most likely a String. But is Sender also a String or maybe an IntentPerson? Is Recipients a String (e.g. comma separated) or a collection? Is Attachments a [String], [URL] or [IntentFile]? How to I find out of which types these inputs have? Is there a better way than guessing and trial and error? The documentation provides very little information about supported types in general and I could find nothing about the types used by different triggers. Additionally each "Shortcut input" offers it self as parameter. So the Email type input does not only offer Subject, Sender, etc. as input parameters but also Email. What parameter type does an intent need no accept in order to receive on Email object? Thank you very much for your help.
Posted
by Agenor.
Last updated
.