Automation & Scripting

RSS for tag

Learn about scripting languages and automation frameworks available on the platform to automate repetitive tasks.

Automation & Scripting Documentation

Posts under Automation & Scripting subtopic

Post

Replies

Boosts

Views

Activity

Is calling different SBApplication objects from different threads bad?
Not quite but maybe sorta related to the errOSAInternalTableOverflow problem I asked about in a different thread, this one deals with crashes our app gets (and much more frequently lately after recent OS updates (15.7.3) are OK'd by our IT department). Our app can run multiple jobs concurrently, each in their own NSOperation. Each op creates its own SBApplication instance that controls unique instances of InDesignServer. What I'm seeing recently is lots of crashes happening while multiple ops are calling into ScriptingBridge. Shown at the bottom is one of the stack crawls from one of the threads. I've trimmed all but the last of our code. Other threads have a similar stack crawl. In searching for answers, Google's AI overview mentions "If you must use multiple threads, ensure that each thread creates its own SBApplication instance…" Which is what we do. No thread can reach another thread's SBApplication instance. Is that statement a lie? Do I need to lock around every ScriptingBridge call (which is going to severely slow things down)? 0 AE 0x1a7dba8d4 0x1a7d80000 + 239828 1 AE 0x1a7d826d8 AEProcessMessage + 3496 2 AE 0x1a7d8f210 0x1a7d80000 + 61968 3 AE 0x1a7d91978 0x1a7d80000 + 72056 4 AE 0x1a7d91764 0x1a7d80000 + 71524 5 CoreFoundation 0x1a0396a64 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 6 CoreFoundation 0x1a03969f8 __CFRunLoopDoSource0 + 172 7 CoreFoundation 0x1a0396764 __CFRunLoopDoSources0 + 232 8 CoreFoundation 0x1a03953b8 __CFRunLoopRun + 840 9 CoreFoundation 0x1a03949e8 CFRunLoopRunSpecific + 572 10 AE 0x1a7dbc108 0x1a7d80000 + 246024 11 AE 0x1a7d988fc AESendMessage + 4724 12 ScriptingBridge 0x1ecb652ac -[SBAppContext sendEvent:error:] + 80 13 ScriptingBridge 0x1ecb5eb4c -[SBObject sendEvent:id:keys:values:count:] + 216 14 ScriptingBridge 0x1ecb6890c -[SBCommandThunk invoke:] + 376 15 CoreFoundation 0x1a037594c ___forwarding___ + 956 16 CoreFoundation 0x1a03754d0 _CF_forwarding_prep_0 + 96 17 RRD 0x1027fca18 -[AppleScriptHelper runAppleScript:withSubstitutionValues:usingSBApp:] + 1036
21
0
665
Mar ’26
Numbers Extension in Shortcuts
I am building an automation using Shortcuts. The shortcut reads text from my Notes, sends it to Apple Intelligence, converts the result into dictionary values, and then saves those values into a Numbers sheet by adding rows through a form. The problem is that when the automation processes multiple lines and adds multiple rows, the Numbers app opens every time a row is added. I would like this process to run automatically at a scheduled time without opening the Numbers app repeatedly on my iPhone. Is there a way to update the Numbers sheet in the background without launching the Numbers app? Please let me know if there is a solution.
1
0
168
Mar ’26
Why do random errOSAInternalTableOverflow errors return when running AppleScripts via ScriptingBridge?
We have an app that controls InDesign Desktop and InDesignServer via hundreds of AppleScripts. Some macOS security updates a while back dictated that we start communicating with other apps via ScriptingBridge. We couldn't afford to convert the hundreds of AppleScripts into direct ScriptingBridge nomenclature, so we opted to keep them as is and instead tell the external apps to: [app doScript:<the script text> language:InDesignScLgApplescriptLanguage withArguments:nil undoMode:InDesignESUMScriptRequest undoName:@"blah"] There are a handful of scripts that we did convert to direct ScriptingBridge. There are times (and under the right circumstances, it's repeatable) when a certain script will have run perfectly dozens of times, and then it will throw errOSAInternalTableOverflow. We create a new SBApplication for every job (which could be a single instance of Desktop or the multiple instances of Server). Why is this error happening seemingly randomly? Is there anything we can do to work around or prevent this?
8
0
395
3w
Can I use AppIntent with tvOS?
The AppIntent feature is available on tvOS since OS 16. https://developer.apple.com/documentation/appintents I tried a real basic integration where I just want simply open a specific tab in my tabbar. But the perform action gets never called. Is it really possible already to use AppIntent on tvOS? Or is this feature still mostly targeted for mobile devices? Also, the documentaiton says so often something about shortcuts app and features, that are not available on tvOS, that I started doubting that the AppIntent is really usable on tvOS. If AppIntents are available and usable for tvOS, what could be wrong, so that I do not see the expected results?
0
0
130
2w
Siri Shortcuts Not Recognized on HomePod mini (audioOS 26.4) – Delegates to Built-in Responses Instead
Bug Report Environment 4× HomePod mini, audioOS 26.4 (23L243) iPhone, iPad, Mac – all running latest OS versions (iOS/iPadOS/macOS 26) iCloud account active, Shortcuts sync enabled on all devices Summary Siri no longer executes custom Shortcuts on any HomePod mini. Instead, the HomePod responds with built-in Siri answers or refers to the internet, as if no custom Shortcuts were registered. The same Shortcuts work correctly via Siri on iPhone, iPad, and Mac. Reproducible Test Case Created a new Shortcut named "Lemon Blue Seven" from scratch – no resemblance to any built-in Siri command, single action: spoken text output. Result: Mac: recognized and executed correctly via Siri iPhone / iPad: recognized and executed correctly via Siri (after re-registration, see below) All 4 HomePod mini: not recognized – Siri responds as if the Shortcut does not exist Steps to Reproduce Create a new Shortcut with a unique name and a single spoken output action Ensure iCloud Shortcuts sync is active on all devices Invoke via Siri on HomePod mini: „Run [Shortcut name]" HomePod responds with a built-in Siri answer instead of executing the Shortcut Additional Observations The issue appeared without any user-initiated changes to the setup Deleting all Shortcuts and re-importing them manually caused Siri registration to also break on iPhone and iPad; this was resolved by disabling iCloud Shortcuts sync, restarting the devices, and re-enabling sync The HomePod issue persisted through this fix – suggesting the HomePod's Intent delegation is broken independently of the hub device's registration state When a Shortcut name resembles a built-in command (e.g. „What time is it?"), the HomePod executes the built-in command instead – confirming it does not consult the user's Shortcut registry at all Troubleshooting Already Performed Multiple HomePod restarts Full factory reset and re-setup of HomePod (multiple times, also tested with only one HomePod active) Voice recognition re-trained Personal Requests disabled and re-enabled iCloud Shortcuts sync disabled on all devices, devices restarted, sync re-enabled sequentially All Shortcuts deleted and manually re-imported Home Hub verified: Bathroom HomePod registered as Home Hub, status „Connected" Tested with a separate Home setup Contacted Apple Support – no resolution provided Expected Behavior Siri on HomePod mini recognizes and executes user-defined Shortcuts by name, as it did prior to this issue and as it continues to do on iPhone, iPad, and Mac. Actual Behavior Siri on HomePod mini ignores user-defined Shortcuts entirely and falls back to built-in responses.
0
0
89
1w
Shortcuts: Can not access submenu of inserted variables inside of newly created dictionaries on mac
While I was creating a shortcut using the dictionary function I encountered a bug. When creating a new dictionary to store the date and some other stuff I set a value to the current date variable. I went to change the date format to one I preferred I was unable to access the submenu to do so. To figure out what was going on I did some testing and here is what I found: You can't access the submenu of any inserted variable This only happens in newly created dictionaries You can be fix the dictionary by simply closing and opening the shortcut This bug does not happen on Iphone How to make this bug happen: Open any shortcut Create a new dictionary Add a variable in the value field You can no longer access the sub menu to edit the variable.
1
0
65
1w
Bug: Finder/AppleScript interaction
I have created a simple AppleScript that makes a folder named with today’s date. For many years, it has worked fine except: If I run the script (from a script app in the menu bar), then dump files into the folder, then change the colored “Tag” on the folder, I get a Finder error - An unexpected error occurred (error code -8076) - and I have to force-quit the Finder to complete the color tagging. If it change the tag before dumping the files, no error occurs. (Please hold the “Doctor, it hurts when I do this …” jokes.) This error has persisted through many macOS major iterations, including Tahoe 26.4.1. Prolly a Finder bug, but not sure. Here’s the source, for anyone interested. set dateStr to getDate() --display dialog dateStr tell application "Finder" activate try --set thisFolder to (the target of the front window) as alias set thisFolder to (the target of the front window) as string make new folder at thisFolder with properties {name:dateStr as string} on error errMsg display dialog "ERROR: " & errMsg end try end tell on getDate() set theDate to current date set theYear to year of theDate as string set theNewYear to third character of theYear & fourth character of theYear set theMonth to month of theDate as number as string if length of theMonth = 1 then set theMonth to "0" & theMonth as string end if set theDay to day of theDate as string if length of theDay = 1 then set theDay to "0" & theDay as string end if return theNewYear & " " & theMonth & " " & theDay as string end getDate
3
0
108
1w
AppEntity / EntityQuery returns multiple results but Shortcuts only displays a single item on newest iOS 26.4
We are observing a regression in iOS 26.4 related to AppIntents, specifically AppEntity + EntityQuery. When using a single AppIntent with a parameter backed by AppEntity and EntityQuery, the query correctly returns multiple entities (e.g. ~50 items). However, in the Shortcuts app UI, only a single item is displayed. This behavior differs from iOS 26.3 and earlier, where all returned entities are correctly displayed in the selection list. This issue significantly impacts dynamic configuration use cases where AppEntity is used to represent server-driven or runtime-generated options.(The screenshots below illustrate the difference in shortcut presentation between iOS 26.4 and earlier versions.)
1
2
154
1w
Mac App Store review policy for Apple Event temporary exception entitlements
I’m looking for some advice regarding the usage of temporary exception entitlements in Mac App Store apps. Specifically the Apple Event Temporary Exception to communicate with other third party applications (not first-party macOS system apps): The Best Practices for Submitting Scriptable and AppleScript Apps to the Mac App Store section is a bit vague (how to 'request' a temporary entitlement?) and I couldn't find it mentioned in the Review Guidelines. Before designing, implementing and testing functionality based on the Apple Event Temporary Exception I’d like to know if these entitlements would: A. Always be rejected on the Mac App Store B. Only accepted in highly specific use cases C. Accepted if there is a clear use case and sufficient argumentation For this particular use case I’d like to send Apple Events to Adobe Illustrator and QuarkXPress. The application helps the user with some design tasks in their documents. The app requests the currently open documents and accesses document content to process used design elements. This is optional functionality that the user must explicitly enable in the app. I’m aware that the com.apple.security.scripting-targets entitlement is preferred. (Side question: are these always allowed or can they also be rejected for third party app scripting?) However, many third party applications don’t offer any scripting access groups in their definition, including Adobe Illustrator and QuarkXPress in this case. So before spending a lot of time implementing this feature I’d like to have some indication whether it is unlikely that sending Apple Events to third party apps will be allowed on the Mac App Store. Thanks for any insights!
5
0
111
2d
Is calling different SBApplication objects from different threads bad?
Not quite but maybe sorta related to the errOSAInternalTableOverflow problem I asked about in a different thread, this one deals with crashes our app gets (and much more frequently lately after recent OS updates (15.7.3) are OK'd by our IT department). Our app can run multiple jobs concurrently, each in their own NSOperation. Each op creates its own SBApplication instance that controls unique instances of InDesignServer. What I'm seeing recently is lots of crashes happening while multiple ops are calling into ScriptingBridge. Shown at the bottom is one of the stack crawls from one of the threads. I've trimmed all but the last of our code. Other threads have a similar stack crawl. In searching for answers, Google's AI overview mentions "If you must use multiple threads, ensure that each thread creates its own SBApplication instance…" Which is what we do. No thread can reach another thread's SBApplication instance. Is that statement a lie? Do I need to lock around every ScriptingBridge call (which is going to severely slow things down)? 0 AE 0x1a7dba8d4 0x1a7d80000 + 239828 1 AE 0x1a7d826d8 AEProcessMessage + 3496 2 AE 0x1a7d8f210 0x1a7d80000 + 61968 3 AE 0x1a7d91978 0x1a7d80000 + 72056 4 AE 0x1a7d91764 0x1a7d80000 + 71524 5 CoreFoundation 0x1a0396a64 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 6 CoreFoundation 0x1a03969f8 __CFRunLoopDoSource0 + 172 7 CoreFoundation 0x1a0396764 __CFRunLoopDoSources0 + 232 8 CoreFoundation 0x1a03953b8 __CFRunLoopRun + 840 9 CoreFoundation 0x1a03949e8 CFRunLoopRunSpecific + 572 10 AE 0x1a7dbc108 0x1a7d80000 + 246024 11 AE 0x1a7d988fc AESendMessage + 4724 12 ScriptingBridge 0x1ecb652ac -[SBAppContext sendEvent:error:] + 80 13 ScriptingBridge 0x1ecb5eb4c -[SBObject sendEvent:id:keys:values:count:] + 216 14 ScriptingBridge 0x1ecb6890c -[SBCommandThunk invoke:] + 376 15 CoreFoundation 0x1a037594c ___forwarding___ + 956 16 CoreFoundation 0x1a03754d0 _CF_forwarding_prep_0 + 96 17 RRD 0x1027fca18 -[AppleScriptHelper runAppleScript:withSubstitutionValues:usingSBApp:] + 1036
Replies
21
Boosts
0
Views
665
Activity
Mar ’26
Numbers Extension in Shortcuts
I am building an automation using Shortcuts. The shortcut reads text from my Notes, sends it to Apple Intelligence, converts the result into dictionary values, and then saves those values into a Numbers sheet by adding rows through a form. The problem is that when the automation processes multiple lines and adds multiple rows, the Numbers app opens every time a row is added. I would like this process to run automatically at a scheduled time without opening the Numbers app repeatedly on my iPhone. Is there a way to update the Numbers sheet in the background without launching the Numbers app? Please let me know if there is a solution.
Replies
1
Boosts
0
Views
168
Activity
Mar ’26
Wallet Automation on Apple Watch
I am trying to create an automation that will anable to add transactions to my app and it’s using a shared shortcut and a quick automation on the user end. it works great on the iPhone but i couldn’t find any way to make it work on my Apple Watch… any help with that?
Replies
0
Boosts
0
Views
236
Activity
Mar ’26
Why do random errOSAInternalTableOverflow errors return when running AppleScripts via ScriptingBridge?
We have an app that controls InDesign Desktop and InDesignServer via hundreds of AppleScripts. Some macOS security updates a while back dictated that we start communicating with other apps via ScriptingBridge. We couldn't afford to convert the hundreds of AppleScripts into direct ScriptingBridge nomenclature, so we opted to keep them as is and instead tell the external apps to: [app doScript:<the script text> language:InDesignScLgApplescriptLanguage withArguments:nil undoMode:InDesignESUMScriptRequest undoName:@"blah"] There are a handful of scripts that we did convert to direct ScriptingBridge. There are times (and under the right circumstances, it's repeatable) when a certain script will have run perfectly dozens of times, and then it will throw errOSAInternalTableOverflow. We create a new SBApplication for every job (which could be a single instance of Desktop or the multiple instances of Server). Why is this error happening seemingly randomly? Is there anything we can do to work around or prevent this?
Replies
8
Boosts
0
Views
395
Activity
3w
Can I use AppIntent with tvOS?
The AppIntent feature is available on tvOS since OS 16. https://developer.apple.com/documentation/appintents I tried a real basic integration where I just want simply open a specific tab in my tabbar. But the perform action gets never called. Is it really possible already to use AppIntent on tvOS? Or is this feature still mostly targeted for mobile devices? Also, the documentaiton says so often something about shortcuts app and features, that are not available on tvOS, that I started doubting that the AppIntent is really usable on tvOS. If AppIntents are available and usable for tvOS, what could be wrong, so that I do not see the expected results?
Replies
0
Boosts
0
Views
130
Activity
2w
Siri Shortcuts Not Recognized on HomePod mini (audioOS 26.4) – Delegates to Built-in Responses Instead
Bug Report Environment 4× HomePod mini, audioOS 26.4 (23L243) iPhone, iPad, Mac – all running latest OS versions (iOS/iPadOS/macOS 26) iCloud account active, Shortcuts sync enabled on all devices Summary Siri no longer executes custom Shortcuts on any HomePod mini. Instead, the HomePod responds with built-in Siri answers or refers to the internet, as if no custom Shortcuts were registered. The same Shortcuts work correctly via Siri on iPhone, iPad, and Mac. Reproducible Test Case Created a new Shortcut named "Lemon Blue Seven" from scratch – no resemblance to any built-in Siri command, single action: spoken text output. Result: Mac: recognized and executed correctly via Siri iPhone / iPad: recognized and executed correctly via Siri (after re-registration, see below) All 4 HomePod mini: not recognized – Siri responds as if the Shortcut does not exist Steps to Reproduce Create a new Shortcut with a unique name and a single spoken output action Ensure iCloud Shortcuts sync is active on all devices Invoke via Siri on HomePod mini: „Run [Shortcut name]" HomePod responds with a built-in Siri answer instead of executing the Shortcut Additional Observations The issue appeared without any user-initiated changes to the setup Deleting all Shortcuts and re-importing them manually caused Siri registration to also break on iPhone and iPad; this was resolved by disabling iCloud Shortcuts sync, restarting the devices, and re-enabling sync The HomePod issue persisted through this fix – suggesting the HomePod's Intent delegation is broken independently of the hub device's registration state When a Shortcut name resembles a built-in command (e.g. „What time is it?"), the HomePod executes the built-in command instead – confirming it does not consult the user's Shortcut registry at all Troubleshooting Already Performed Multiple HomePod restarts Full factory reset and re-setup of HomePod (multiple times, also tested with only one HomePod active) Voice recognition re-trained Personal Requests disabled and re-enabled iCloud Shortcuts sync disabled on all devices, devices restarted, sync re-enabled sequentially All Shortcuts deleted and manually re-imported Home Hub verified: Bathroom HomePod registered as Home Hub, status „Connected" Tested with a separate Home setup Contacted Apple Support – no resolution provided Expected Behavior Siri on HomePod mini recognizes and executes user-defined Shortcuts by name, as it did prior to this issue and as it continues to do on iPhone, iPad, and Mac. Actual Behavior Siri on HomePod mini ignores user-defined Shortcuts entirely and falls back to built-in responses.
Replies
0
Boosts
0
Views
89
Activity
1w
Shortcuts: Can not access submenu of inserted variables inside of newly created dictionaries on mac
While I was creating a shortcut using the dictionary function I encountered a bug. When creating a new dictionary to store the date and some other stuff I set a value to the current date variable. I went to change the date format to one I preferred I was unable to access the submenu to do so. To figure out what was going on I did some testing and here is what I found: You can't access the submenu of any inserted variable This only happens in newly created dictionaries You can be fix the dictionary by simply closing and opening the shortcut This bug does not happen on Iphone How to make this bug happen: Open any shortcut Create a new dictionary Add a variable in the value field You can no longer access the sub menu to edit the variable.
Replies
1
Boosts
0
Views
65
Activity
1w
Bug: Finder/AppleScript interaction
I have created a simple AppleScript that makes a folder named with today’s date. For many years, it has worked fine except: If I run the script (from a script app in the menu bar), then dump files into the folder, then change the colored “Tag” on the folder, I get a Finder error - An unexpected error occurred (error code -8076) - and I have to force-quit the Finder to complete the color tagging. If it change the tag before dumping the files, no error occurs. (Please hold the “Doctor, it hurts when I do this …” jokes.) This error has persisted through many macOS major iterations, including Tahoe 26.4.1. Prolly a Finder bug, but not sure. Here’s the source, for anyone interested. set dateStr to getDate() --display dialog dateStr tell application "Finder" activate try --set thisFolder to (the target of the front window) as alias set thisFolder to (the target of the front window) as string make new folder at thisFolder with properties {name:dateStr as string} on error errMsg display dialog "ERROR: " & errMsg end try end tell on getDate() set theDate to current date set theYear to year of theDate as string set theNewYear to third character of theYear & fourth character of theYear set theMonth to month of theDate as number as string if length of theMonth = 1 then set theMonth to "0" & theMonth as string end if set theDay to day of theDate as string if length of theDay = 1 then set theDay to "0" & theDay as string end if return theNewYear & " " & theMonth & " " & theDay as string end getDate
Replies
3
Boosts
0
Views
108
Activity
1w
AppEntity / EntityQuery returns multiple results but Shortcuts only displays a single item on newest iOS 26.4
We are observing a regression in iOS 26.4 related to AppIntents, specifically AppEntity + EntityQuery. When using a single AppIntent with a parameter backed by AppEntity and EntityQuery, the query correctly returns multiple entities (e.g. ~50 items). However, in the Shortcuts app UI, only a single item is displayed. This behavior differs from iOS 26.3 and earlier, where all returned entities are correctly displayed in the selection list. This issue significantly impacts dynamic configuration use cases where AppEntity is used to represent server-driven or runtime-generated options.(The screenshots below illustrate the difference in shortcut presentation between iOS 26.4 and earlier versions.)
Replies
1
Boosts
2
Views
154
Activity
1w
Mac App Store review policy for Apple Event temporary exception entitlements
I’m looking for some advice regarding the usage of temporary exception entitlements in Mac App Store apps. Specifically the Apple Event Temporary Exception to communicate with other third party applications (not first-party macOS system apps): The Best Practices for Submitting Scriptable and AppleScript Apps to the Mac App Store section is a bit vague (how to 'request' a temporary entitlement?) and I couldn't find it mentioned in the Review Guidelines. Before designing, implementing and testing functionality based on the Apple Event Temporary Exception I’d like to know if these entitlements would: A. Always be rejected on the Mac App Store B. Only accepted in highly specific use cases C. Accepted if there is a clear use case and sufficient argumentation For this particular use case I’d like to send Apple Events to Adobe Illustrator and QuarkXPress. The application helps the user with some design tasks in their documents. The app requests the currently open documents and accesses document content to process used design elements. This is optional functionality that the user must explicitly enable in the app. I’m aware that the com.apple.security.scripting-targets entitlement is preferred. (Side question: are these always allowed or can they also be rejected for third party app scripting?) However, many third party applications don’t offer any scripting access groups in their definition, including Adobe Illustrator and QuarkXPress in this case. So before spending a lot of time implementing this feature I’d like to have some indication whether it is unlikely that sending Apple Events to third party apps will be allowed on the Mac App Store. Thanks for any insights!
Replies
5
Boosts
0
Views
111
Activity
2d