anthropics / anthropics/claude-code
[BUG] "Word (By Anthropic)" extension: replace_text always fails with AppleScript syntax error
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
The replace_text function of the "Word (By Anthropic)" desktop extension always fails. It generates malformed AppleScript regardless of the search text or the "all" parameter — Word rejects it with a syntax error because the "replace" parameter is set twice in the execute command.
### What Should Happen?
replace_text should find and replace the given text in the active Word document without error.
### Error Messages/Logs
```shell
execute find findObject replace replace all replace replace all
→ syntax error: The «class 5642» parameter is specified more than once. (-2750)
```
### Steps to Reproduce
1. Open a .docx file with the "Word (By Anthropic)" extension (open_document)
2. Call replace_text with any find/replace string, e.g. find: "test", replace: "Test"
3. Observe AppleScript syntax error every time, even for a single plain word
### Claude Model
Sonnet (default)
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
_No response_
### Claude Code Version
Claude Desktop 1.52386.3
### Platform
Other
### Operating System
macOS
### Terminal/Shell
Other
### Additional Information
This occurs via the "Word (By Anthropic)" local MCP extension in Claude Desktop, not the Claude Code CLI. Device: macOS, arm64.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Word (By Anthropic) extension's replace_text entry point and reproduce the call with find "test" and replace "Test" in an active Word document. Inspect the generated AppleScript command; done means it no longer specifies the replace parameter twice and the text replacement succeeds without a syntax error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100