Scripting Bridge

RSS for tag

Automate scriptable apps by sending and receiving Apple events using Scripting Bridge.

Posts under Scripting Bridge tag

4 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Can't write a property through ScriptingBridge
Staring to use ScriptingBridge in Swift to enable faster scripting access to an external app (Devonthink) and therefore avoid having to use an AppleScript as a conduit to call a Swift command line utility and deal with its results. The plan is to be able to read the plaintext of a record (no problem) and change the record name in Devonthink based on its contents. But I can’t seem to write to a property, instead getting an error “Cannot assign to property: ‘***’ is immutable”. Any guidance how to get around this?
1
0
44
10h
tccd reports Apple Events entitlement check error, despite a process having it
HI! I am developing an application that should utilize ScriptingBridge.framework to interact with another process. Firstly, I created a separate test application for which I have added Apple Events entitlements via "Signing & Capabilities" section in Xcode and updated its Info.plist to have "Privacy - AppleEvents Sending Usage Description". While the test app works fine (I see an automation request popup and the process executes as expected) the main application where I want to integrate this functionality gets closed immediately after reaching the code interacting with Scripting Bridge. On its launch, I see the following error message from tccd in Console: Prompting policy for hardened runtime; service: kTCCServiceAppleEvents requires entitlement com.apple.security.automation.apple-events but it is missing for accessing={TCCDProcess: identifier=<app bundleID>, ..., binary_path=<path to the app's binary>} I had no such issues with the test app. Moreover, I should mention that the bundle I want to have with such functionality is stored in another bundle, both main and inner bundles aren't sandboxed, and the target app has Application is agent (UIElement) key set in Info.plist. Can you suggest any ideas as to why processes behave so differently despite having pretty much the same build configurations?
14
1
408
2w
How to listen for Privacy & Security > Automation > System Events status changes in MacOS Swift
My project (an non-sandbox app) was written in Swift on MacOS and it can execute the Apple script successfully. I would like to listen for Privacy &amp; Security &gt; Automation &gt; System Events status changes when the user changes it in System Settings to disable or enable my app feature in MacOS. My app can receive Accessibility changes through this notification "com.apple.accessibility.api" Are there any system notifications for my app to receive Automation &gt; System Events status changes? Thank you!
2
1
427
Mar ’24