Following Episode 588 I was inspired to try to write some text services to automate bits of my workflow.
Assume for the sake of argument that I’ve written a text service in Automator called “Speak Text” which accepts text in any application, and has a single “Speak Text” action which speaks the input.
If I now right-click on some selected text in Microsoft Word, I can see the action. I click it. I get two error dialogs almost simultaneously, one saying “The “Speak Text” Service could not be used” and the other “There was a problem with the input to the Service”.
Poking around in the Console I can see what the problem is: Word is trying to read the service workflow file, and the sandbox is blocking it:
Sandbox: Microsoft Word(2590) deny(1) file-read-data /Users/NAME/Library/Services/Speak Text.workflow
Violation: deny(1) file-read-data /Users/NAME/Library/Services/Speak Text.workflow
Process: Microsoft Word [2590]
Path: /Applications/Microsoft Word.app/Contents/MacOS/Microsoft Word
Load Address: 0x10bf8e000
Identifier: com.microsoft.Word
Version: 16.49.21050901 (16.49)
Code Type: x86_64 (Native)
Parent Process: launchd [1]
Responsible: /Applications/Microsoft Word.app/Contents/MacOS/Microsoft Word
User ID: 502
Date/Time: 2021-05-20 14:34:14.438 GMT+1
OS Version: macOS 11.3.1 (20E241)
Report Version: 8
I’ve already given Word full disk access in the security System Preferences pane, but that doesn’t help.
Editing the Word app to remove sandboxing (which if I can do it will presumably work) feels like a bad (and very fragile) approach, but I don’t have any other ideas.
For what it is worth this isn’t just confined to Word: I see the same problem with Preview. But Word is what I want to get working.
Help/thoughts much appreciated!