Hello Shortcuts community!
I want to obtain a list of my notes, and well, update them, delete them if needed, and so on. These are simple actions that I can already do.
For this, I saw that shortcuts was pretty simple, and I could get what I wanted and pipe it through the terminal. However, even though I'm a programmer, there's a lot that I'm missing since I cannot pipe anything to the terminal.
I made a simple shortcut to give me some text, and I could obtain it via -shortcuts run "Example" | cat-, which well, gave me the output but with a %.
aaa**%**
Now, I guess this works, the important thing is for me to obtain something from shortcuts so that I can configure simple things like obtaining a note, a mail, run some javascript in the browser and so on while obtaining some output via the terminal.
So, I configured something like this:
While I do get a dictionary (only in the shortcuts app, not in the terminal) like:
{ "Title": "Some title" }
And actually a list of them, I don't have them in an array that I would have for my command. And for some reason I've only been able to obtain either the name or the body.
Now, I put them into a text with get text from Repeated results, but I don't think I have a valid Dictionary (JSON) array that I can use, since the terminal doesn't obtain nothing.
So far I've tried:
echo $(shortcuts run "Find Notes")
echo $(shortcuts run "Find Notes" --output-type public.utf8-plain-text -o -)
shortcuts run "Find Notes" | xargs
I wonder what am I missing. I'm not creating the array of dictionaries like I'd like, nor outputting it.
On the other hand, I have some AppleScripts that work, however, given that I cannot find munch information about the support status of AppleScript, I though to update to Shortcuts which is obtaining updates, and then I'm trying to do this simple example on shortcuts.
Thanks for taking a look!
Automation & Scripting
RSS for tagLearn about scripting languages and automation frameworks available on the platform to automate repetitive tasks.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hey everyone,
I have an issue I'm running into – maybe someone has the expertise to help!
I've created an app that adds Intents to the Shortcuts app, to interact with S3-compatible object storage. Everything works fine, until you decide to upload/download a large file, that your internet connection cannot handle in the ~30-second intent timeout.
I've explored uploading files with a background task which seems to work somehow, but the bigger issue would be downloading larger files, as other parts of the subsequent shortcut may rely on it.
To the question: Is there some way of increasing the timeout for a shortcuts intent, or a way to "trick" shortcuts into letting my custom intents download/upload files without timing out?
Thanks so much!
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Shortcuts
Background Tasks
Intents
App Intents
My app uses App Intents to create App Shortcuts.
When I build and run my app in Xcode, the App Shortcuts Preview tool (under Product menu) shows the following message:
No Flexible Matching Assets
This target is for a platform which is not supported by Flexible Matching or does not have Flexible Matching enabled.
All of my project's targets are iPhone only with a minimum deployment of 18.0. In the build settings for this project, Enable App Shortcuts Flexible Matching is set to Yes. (build settings reference)
Any guidance on how to troubleshoot this? Thank you!
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Xcode
Siri and Voice
Shortcuts
App Intents
I am trying to create an App Intent that lets a user select a day in the itinerary of a trip. The trip has to be chosen before the days available can be displayed.
When the PlanActivityIntentDemo intent is ran from the shortcuts app, the trip selected is not injected into the appropriate TripItineraryDayQueryDemo Entity Query. Is there a way to get the selected trip to be injected at run time from shortcuts app. Here's some code for illustration:
// Entity Definition:
import AppIntents
struct ShortcutsItineraryDayEntityDemo: Identifiable, Hashable, AppEntity {
typealias DefaultQuery = TripItineraryDayQueryDemo
static var typeDisplayRepresentation: TypeDisplayRepresentation = "Trip Itinerary Day"
var displayRepresentation: DisplayRepresentation {
"Trip Day"
}
var id: String
static var defaultQuery: DefaultQuery {
TripItineraryDayQueryDemo()
}
init() {
self.id = UUID().uuidString
}
}
struct TripItineraryDayQueryDemo: EntityQuery {
// This only works in shortcut editor but not at runtime. Why? How can I fix this issue?
@IntentParameterDependency<PlanActivityIntentDemo>(\.$tripEntity)
var tripEntity
@IntentParameterDependency<PlanActivityIntentDemo>(\.$title)
var intentTitle
func entities(for identifiers: [ShortcutsItineraryDayEntityDemo.ID]) async throws -> [ShortcutsItineraryDayEntityDemo] {
print("entities being called with identifiers: \(identifiers)")
// This method is called when the app needs to fetch entities based on identifiers.
let tripsStore = TripsStore()
guard let trip = tripEntity?.tripEntity.trip,
let itineraryId = trip.firstItineraryId else {
print("No trip or itinerary ID can be found for the selected trip.")
return []
}
return [] // return empty for this demo
}
func suggestedEntities() async throws -> [ShortcutsItineraryDayEntityDemo] {
print("suggested itinerary days being called")
let tripsStore = TripsStore()
guard let trip = tripEntity?.tripEntity.trip,
let itineraryId = trip.firstItineraryId else {
print("No trip or itinerary ID found for the selected trip.")
return []
}
return []
}
}
struct PlanActivityIntentDemo: AppIntent {
static var title: LocalizedStringResource { "Plan New Activity" }
// The selected trip fails to get injected when intent is run from shortcut app
@Parameter(title: "Trip", description: "The trip to plan an activity for", requestValueDialog: "Which trip would you like to plan an activity for?")
var tripEntity: ShortcutsTripEntity
@Parameter(title: "Activity Title", description: "The title of the activity", requestValueDialog: "What do you want to do or see?")
var title: String
@Parameter(title: "Activity Day", description: "Activity Day")
var activityDay: ShortcutsItineraryDayEntity
func perform() async throws -> some ProvidesDialog {
// This is a demo intent, so we won't actually perform any actions.
.result(dialog: "Activity '\(title)' planned")
}
}
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
SwiftUI
App Intents
Apple Intelligence
Can someone please give me a clue who to go about creating an automation that will open an app click log in, close 2 pop up windows the select an item on screen spin a when collect my prize then log out of the app. I want it to do this once a hour.
Topic:
App & System Services
SubTopic:
Automation & Scripting
Hello!
I am excited to try out the new continueInForeground API with iOS 26.
I was wondering, what is the suggested way to transport meta data to the main app?
Before, with SiriKit intents I would use the .onContinueUserActivity() API and were able to pass a NSUserActivity from the Shortcut to the Main app.
Now, with the continueInForeground() call I am not sure – what would be your suggestion?
Of course, I can store some data in UserDefaults, but that feels like a workaround.
Happy to get some input on this!
Thanks a lot and have a great day!
Hi i'm new to swift/swiftui
i want to my app shortcut to have the ability to take a photo within my AppIntent instead of having to configure a 'Take a photo' action in the Shortcuts app and then parsing that to my Appintent (for less human error).
Is this possible?
I read there's a protocol called CameraCaptureIntent but i think it's only used for a separate extension like for Control Center, Lock Screen, and Action buttons :(
I’m looking into activating my gate (has a dedicated app to it) while getting near home.
i thought that a combination of Car bluetooth connection/Carplay connection as well as a 50 meter radius from home location would be nice to trigger the gate app.
However, I find it hard to set these 2 parallel conditions in Shortcuts. I managed to set connection to car’s Bluetooth, but next screen would suggest the “do” action rather than offer additional conditions.
i couldn‘t handle the “if” option.
would like some help.
Is there a way using a shell script or AppleScript to add a custom icon to a desktop shortcut? I can create the shortcut in a script but I have to manually change the icon.
thx much
Topic:
App & System Services
SubTopic:
Automation & Scripting
Hi,
we're having trouble implementing search through Siri voice commands.
We already did it successfully for audio playback using INPlayMediaIntentHandling.
For search, none of the available ways works.
Both INSearchForMediaIntentHandling and ShowInAppSearchResultsIntent never open the App in the first place. We tried various commands, but e.g. "Search for " sometimes opens the Apple Music app and sometimes shows a Google search widget. Our app is never taken into consideration for providing any results.
We implemented all steps mentioned in WWDC videos and documentation (e.g. https://developer.apple.com/documentation/appintents/making-in-app-search-actions-available-to-siri-and-apple-intelligence), but nothing seems to work.
We're mainly testing on iOS 18 currently. Any idea why this is not working?
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Siri and Voice
SiriKit
Intents
App Intents
Hello,
I'm evaluating if it's worth to expose shortcuts from our app, it seems to be working fine on my machine - Apple Silicon, latest Tahoe beta, Xcode 26 beta.
But if I compile the same code on our intel build agents which are running latest macOS 15 and Xcode 26 beta, once I install the bundle to /Applications on Tahoe I don't see any shortcuts.
Only other difference is that CI build is signed with distribution DeveloperID certificate - I re-signed the build with my dev certificate and it has no effect.
I found out that linkd is somehow involved in the discovery process and most relevant logs look like this:
default (...) linkd Registry com.**** is not link enabled com.apple.appintents
debug (...) linkd ApplicationService Created AppShortcutClient with bundleId: com.**** com.apple.appintents
error (...) linkd AppService Unable to find AppShortcutProvider for com.**** com.apple.appintents
Could you please advice where to look for the problem?
Hello,
I have an AppIntent that uses the AudioPlaybackIntent to trigger my app to open and initiate an AVPlayer that plays back a media stream I control. When the phone is unlocked, everything works as I expect. The app opens and plays the audio.
However, when the phone is locked, any attempt to invoke the intent causes a "Request Code" dialog to be displayed. This seems counter to what I would expect with the AudioPlaybackIntent usage. Am I able to accomplish what I'm after here with AppIntents? Does the fact that I'm using openAppWhenRun require me to have the phone unlocked somehow?
import AppIntents
import Foundation
struct PlayStationAppIntent: AudioPlaybackIntent {
static var title: LocalizedStringResource = "Play radio station"
static var description: IntentDescription = .init("Play radio station")
static var notification: Notification.Name = .init("playStation")
static var openAppWhenRun: Bool = true
init() {}
func perform() async throws -> some IntentResult {
AudioPlayerService.shared.play()
return .result()
}
}
Hi everyone,
I'm looking for a way to programmatically set the left/right audio balance to perfect center (50/50) using either a Terminal command or AppleScript.
Background:
The audio balance slider in System Settings > Sound > Output & Input works functionally, but I have difficulty determining when it's positioned at the exact center point. The visual nature of the slider makes it challenging for me to achieve the precision I need, and I end up adjusting it repeatedly trying to get it perfectly centered.
What I'm looking for:
A Terminal command that can set the audio balance to exact center
An AppleScript that accomplishes the same thing
Any other programmatic method to ensure perfect 50/50 balance
I've tried searching through the defaults command documentation and Core Audio frameworks but haven't found the right approach yet. Has anyone successfully automated this setting before?
Any help would be greatly appreciated!
Thanks in advance,
Dylan
Issue: CSV Headings Not Appearing in Shortcut-Generated File
I'm using an iPhone 16 Pro with iOS 18.5 and the latest Shortcuts app to log expenses into a CSV file. The shortcut works fine, except the resulting file doesn't include the column headings.
Here’s what I’ve done:
Created a file called Expenses.csv with this single header line:
Date,Price,Category,Store,Notes,Location
Saved it to both /iCloud Drive and /iCloud Drive/Shortcuts (via iCloud on my Windows PC).
My Shortcut builds the CSV line from inputs (date, price, category, etc.) and appends it to the file.
I renamed the variables only in the final “Text” block, since renaming in earlier blocks seems no longer possible in this Shortcuts version.
Despite this setup, the file doesn’t preserve the header row—it either doesn’t show up, or gets overwritten.
Goal:
Have a persistent CSV file with the correct headers once, and each new entry appended below the correct columns.
Can anyone help me figure out what I’m doing wrong?
I'm soliciting you because I'm having a problem using the 3D short cut for my ios application in uikit in the AppDelegate file but it's impossible to redirect the route when the user has completely killed the application. It works as a background application. I'd like it to redirect to the searchPage search page when the application is fully closed and the user clicks on search with 3D touch.
final class AppDelegate: UIResponder, UIApplicationDelegate {
lazy var window: UIWindow? = {
return UIWindow(frame: UIScreen.main.bounds)
}()
private let appDependencyContainer = Container()
private let disposeBag = DisposeBag()
var pendingDeeplink: String?
private lazy var onboardingNavigationController: UINavigationController = {
let navigationController = UINavigationController(nibName: nil, bundle: nil)
navigationController.setNavigationBarHidden(true, animated: false)
return navigationController
}()
private func handleShortcutItem(_ shortcutItem: UIApplicationShortcutItem) {
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first(where: { $0.isKeyWindow }),
let rootVC = window.rootViewController else {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { [weak self] in
self?.handleShortcutItem(shortcutItem)
}
return
}
if let presentedVC = rootVC.presentedViewController {
presentedVC.dismiss(animated: !UIAccessibility.isReduceMotionEnabled) { [weak self] in
self?.executeShortcutNavigation(shortcutItem)
}
} else {
executeShortcutNavigation(shortcutItem)
}
}
private func executeShortcutNavigation(_ shortcutItem: UIApplicationShortcutItem) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
guard let self = self else { return }
switch shortcutItem.type {
case ShortcutType.searchAction.rawValue:
self.mainRouter.drive(to: .searchPage(.show), origin: AppRoutingOrigin())
case ShortcutType.playAction.rawValue:
self.mainRouter.drive(to: .live(channel: Channel(), appTabOrigin: AppTabOrigin.navigation.rawValue), origin: AppRoutingOrigin())
case ShortcutType.myListHistoryAction.rawValue:
self.mainRouter.drive(to: .myList(.history), origin: AppRoutingOrigin())
default:
break
}
}
}
What I've tried:
Adding delays with DispatchQueue.main.asyncAfter
Checking for window availability and rootViewController
Dismissing presented view controllers before navigation
Environment:
iOS 15+
Swift 6
Using custom router system (mainRouter)
App supports both SwiftUI and UIKit
Questions:
What's the best practice for handling shortcuts on cold launch vs warm launch?
How can I ensure the router is properly initialized before navigation?
I would like to have an AppEntity with a Property that is a Date, which is only the date, not the time. ie the equivalent of 09/14/2025, not 09/14/2025 09:00 UTC
How would I model this? How would I create an EntityPropertyQuery for this? If I add QueryProperties they have the UI in Shortcuts pick a time too.
Thanks!
I want to offer the user the opportunity to add more stuff to a list in AppIntents, but nothing I've tried "loops back" to the first Siri query. Checked several LLMs and they are suggest using "requestDialog" which doesn't exist, and calling recursively my AppIntent.
Is this even possible?
I and many of my users observed the problem that the Shortcuts app seems to confuse and swap actions of different apps from the same developer. This happens after updating to iOS 26.
This breaks many Shortcuts. Deleting one of the apps or re-adding the actions sometimes seems to help.
Does anybody else observe this problem, or know how to handle this?
My phone turns or gets connected to Beats, Aipods max 2, and sometimes the Marshall Bluetooth device but it keeps triggering the automation for “When Connected To Bluetooth” - My Car
tried deleting and recreating the automation and it’s still buggy.
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Scripting
Shortcuts
Core Bluetooth
Here's my AppleScript:
tell application "Finder"
activate
open application file "Messages.app" of folder "Applications" of folder "System" of startup disk
end tell
I just need the step to send the message making the script automatically send the message which has already been created. This step opens the completed iMessage ready to send . I want to send it without and keyboard usage. All that is needed is the step to send
Topic:
App & System Services
SubTopic:
Automation & Scripting