Shortcuts

RSS for tag

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

Posts under Shortcuts tag

107 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Seeking Assistance with Bulk Input of Pronunciation Corrections for iOS
Hello iOS Developer Community, I hope this message finds you healthy and happy. I am reaching out to seek your expertise and assistance with a particular challenge I’ve encountered while using the Speak Screen and Speak Selection features on iOS. As you may know, these features are incredibly useful for reading text aloud, but they sometimes struggle with the correct pronunciation of homographs—words that are spelled the same but have different meanings and pronunciations. An example of this is the word “live,” which can be pronounced differently based on the context of the sentence. To enhance my user experience, I am looking to input corrections for the pronunciation of “live” in its “happening now” context, such as in “live broadcast” or “live event.” However, the current process requires manual entry for each phrase, which is quite labor-intensive. I am wondering if there is a way to automate or streamline this process, perhaps through a shortcut or script that allows for bulk input of these corrections. Additionally, if anyone has already compiled a list of common phrases with homographs and their correct pronunciations, I would greatly appreciate it if you could share it or guide me on where to find such resources. Your insights and guidance on this matter would be invaluable, and I believe any solutions could benefit not just myself but many other users facing similar issues. Thank you for your time and consideration. I look forward to any suggestions or advice you may have. Best regards, Alec
0
0
290
Apr ’24
Dispatch queue: com.apple.NSURLSession-delegate after executing self written shortcut
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!
5
0
491
Apr ’24
How to create AppEntity shortcut to be shown in Spotlight
I am exploring Appi-Intent and Appshortcut. We can create an action shortcut by using the following code. struct WatchListShortcut: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: WatchListAppIntent(), phrases: [ "Tell \(.applicationName) to open first item in watch list", ], shortTitle: "WatchList item", systemImageName: "systemimage" ) } } What I want to show an entity shortcut like shown in the below screenshot. linkText I am not sure how to create the shortcut like Assigned one in the above screen.
0
0
345
Apr ’24
scaning and saving
hi there, would someone kindly show me the syntax for the following please. I have the shortcut scan which is good but i want to save the scan to Icloud / documents / and then to a folder called scans. i somehow have the syntax wrong when in the "save" area I have Save file to Icloud drive then Subpath to the folder "scans" but this doesn't seem to work. Anyone put me in the correct direction please ? regards Nick
0
0
247
Apr ’24
AppIntent Parameter Argument List of Apps
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!
1
0
411
Apr ’24
Issue with Shortcuts and relocated home folder
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.
0
0
256
Apr ’24
How to invoke an Apple Iphone to take screen shot
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.
0
0
411
Mar ’24
The shortcut does not work as expected; the content entered cannot be synchronized to the memo.
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
2
0
303
Mar ’24
Run a python script as a quick action in finder on selected folder
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
4
1
1.8k
Mar ’24
Shortcuts doesn't honor Always Allow with custom AppEntity!
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
0
0
367
Feb ’24
Convert SiriKit Custom Intents using non configurable parameters to AppIntents
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.
0
0
478
Feb ’24
Screen recording Shortcut
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.
0
0
256
Feb ’24