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.
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
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?
l’m trying to automate Apple Music on macOS Tahoe 26 using ScriptingBridge. Scripts that previously worked for controlling playback, fetching track info, or manipulating playlists no longer function.
For example, code like this used to work:
`import ScriptingBridge
let music = SBApplication(bundleIdentifier: "com.apple.Music") as! MusicApplication
print(music.currentTrack?.name ?? "No track playing")`
But now it fails, returning nil for track info and failing to send playback commands.
Questions:
Has ScriptingBridge been deprecated or broken in Tahoe 26 for Apple Music?
Any guidance or example code would be appreciated.
When you correctly implement EntityPropertyQuery on an AppEntity, Shortcuts will expose a "Find Entity" action that calls into entities(matching:mode:sortedBy:limit:). This is demoed in the "Dive into App Intents" session and works as expected.
However, with this action, you can change the "All Entity" input to a list variable which changes the action text from "Find All Entity" to "Filter Entity where" still giving you the same filter, sort and limit options. This appears to work as expected too. But, what's unexpected is that this filter action does not appear to call any method on my AppEntity code. It doesn't call entities(matching:mode:sortedBy:limit:). One would think there would need to be a filter(entities:matching:mode:sortedBy:limit:) to implement this functionality. But Shortcut just seems to do it all on it's own. I'm mostly wondering, how is this even working?
Here's some example code:
import AppIntents
let books = [
BookEntity(id: 0, title: "A Family Affair"),
BookEntity(id: 1, title: "Atlas of the Heart"),
BookEntity(id: 2, title: "Atomic Habits"),
BookEntity(id: 3, title: "Memphis"),
BookEntity(id: 4, title: "Run Rose Run"),
BookEntity(id: 5, title: "The Maid"),
BookEntity(id: 6, title: "The Match"),
BookEntity(id: 7, title: "Where the Crawdads Sing"),
]
struct BookEntity: AppEntity, Identifiable {
static var typeDisplayRepresentation: TypeDisplayRepresentation = "Book"
var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(title)") }
static var defaultQuery = BookQuery()
var id: Int
@Property(title: "Title")
var title: String
init(id: Int, title: String) {
self.id = id
self.title = title
}
}
struct BookQuery: EntityQuery {
func entities(for identifiers: [Int]) async throws -> [BookEntity] {
return identifiers.map { id in books[id] }
}
}
extension BookQuery: EntityPropertyQuery {
static var properties = QueryProperties {
Property(\BookEntity.$title) {
EqualToComparator { str in { book in book.title == str } }
ContainsComparator { str in { book in book.title.contains(str) } }
}
}
static var sortingOptions = SortingOptions {
SortableBy(\BookEntity.$title)
}
func entities(
matching comparators: [(BookEntity) -> Bool],
mode: ComparatorMode,
sortedBy: [Sort<BookEntity>],
limit: Int?
) async throws -> [BookEntity] {
books.filter { book in comparators.allSatisfy { comparator in comparator(book) } }
}
}
The example Shortcut first invokes entities(matching:mode:sortedBy:limit:) with comparators=[], sortedBy=[], limit=nil to fetch all Book entities. Next the filter step correctly applies the title contains filter but never calls entities(matching:mode:sortedBy:limit:) or even the body of the ContainsComparator. But the output is correctly filtered.
Suppose I want to create a dummy switch for HomeKit using an app.
I run the app for the first time, the app registers itself as a dummy switch and all accessories see the app as an OFF switch.
The following day, I run the app again and turn the dummy switch ON. All accessories that were monitoring the status of that switch, adjusted themselves accordingly, run their automations and so on.
Can an app do that in iOS, macOS, iPadOS, watchOS, etc.?
If so, can you point me in the right direction?
I have a VBScript routine to print envelopes by automating Word. This works just fine.
Now I'm trying to do the same thing with AppleScript, also using the Word application. Here is what I have so far:
set recipientAddress to text returned of (display dialog "Enter the recipient's address:" default answer "")
-- Prompt for recipient city, state, and zip
set recipientCityStateZip to text returned of (display dialog "Enter the recipient's city, state, and zip:" default answer "")
-- Combine all address parts into a full address
set fullAddress to recipientName & return & recipientAddress & return & recipientCityStateZip
-- Create a new Word document and print the envelope
set dialogResult to display dialog "To print envelope for:" & return & return & recipientName & return & recipientAddress & return & recipientCityStateZip & return & return & "Center envelope upside-down in printer with flap on left" & return & return & "Continue?" buttons {"Yes", "No"} default button 2 with icon caution
if button returned of dialogResult is "Yes" then
tell application "Microsoft Word"
set wdDoc to make new document
-- Print the envelope with the collected recipient address and hard-coded return address
-- wdDoc's print out envelope(address:fullAddress, returnAddress:returnAddress)
-- Close the document without saving
close wdDoc saving no
end tell
end if
What does NOT work is the commented line near the end of the script which starts with -- wdDoc's print out envelope...
Either I am doing it wrong, or Word for Mac can't be automated that way. Can anyone help with this script, or at least suggest a different method to print an envelope on demand?
Thanks...
I want to create an Apple Shortcut that responds to text messages I receive while on vacation with an Out of the Office message.
However, I want to exclude some people from getting this message, namely family and work colleagues. Does anyone know how to do this on iOS 18. I'm stuck on how to exclude contacts I don't want to send the message to.
Does anyone know how to do this?
Hello.
I have NFC tags that I scan before walking my dog, that set off a list of shortcuts.
The shortcuts have been failing the last couple of weeks but were fine before that. seems to be a problem with linking to starting a walk in apple watch workouts?!
I have the latest iOS 18 public beta running (18.1) and watchOS 11.0.1
I keep seeing that there's a shortcut called "Add transaction" where whenever a card was tapped from apple wallet, you can add some automation.
https://support.apple.com/en-au/guide/shortcuts/apd65c67538a/7.0/ios/17.0
However, I cannot for the life of me find this option on my iphone 13 ios 17.6.1
All I can find when I go to the shortcuts app and search for transactions or apple wallet, I get 2 options to send/receive payments which isn't what I'm looking for.
Did apple remove this shortcut??
Hello.
tell application "Microsoft Excel"
Where can I find complete help for all Excel commands?
I have created swift command line project and i have added logic to executing apple script using NSAppleScript. That will launch Microsoft Excel file
I am launching this swift command line executable from java using process launch.
3)This is not prompting me. It is throwing exception "Not authorized to send Apple events to Microsoft Excel."
I have already tried out this option
Added info.plist with NSAppleEventsUsageDescription
Added entitlement with com.apple.security.automation.apple-events to true
In packages i have selected this entitlement
i have select the bundle identifier , team and signing certificate "Development" and automatically manage signing.
can you please suggest what could i missed ?
I have:
an Automator workflow saved as an application "workflow.app"
an Apple Script saved as an application "script.app"
a PDF file residing on Desktop "test.pdf"
How do I launch workflow.app and pass test.pdf as the input for workflow from inside script.app?