Overview
This skill is used to send messages in the macOS desktop version of WeChat, prioritizing a stable UI automation sequence:
- Activate WeChat and confirm it is the foreground application
- Use keyboard shortcuts to open search or switch conversations
- Both the contact name and the message body are pasted via the clipboard to avoid input method interception
When to use
- The user explicitly requests sending a message to a contact in the macOS WeChat client
- Typing Chinese directly is easily disrupted by the input method, so clipboard pasting must be used instead
Do not prioritize using this skill in these scenarios:
- The user only wants to send a web WeChat message
- The target environment is not macOS desktop
Prerequisites
- WeChat is installed and logged in on macOS
- The runtime environment has been granted Accessibility permission
Standard workflow
1. First do a dependency check
python3 scripts/wechat_auto.py doctor
This check will confirm:
WeChatWhether it can be launchedosascript、pbcopy、pbpasteWhether it is available
When any required item is missing, the command will output an error and exit with a non-zero status.
2. Send the message directly
Execute from the skill root directory:
scripts/send_message "文件传输助手" "测试消息"
When debug information is needed:
python3 scripts/wechat_auto.py send "文件传输助手" "测试消息" --debug --delay 0.8
Quick commands
- Dependency check:
python3 scripts/wechat_auto.py doctor
- Send message:
scripts/send_message "张三" "你好,这是自动消息"
Common risks
- Without Accessibility permission, keyboard shortcuts will fail
- When WeChat is not in the foreground, pasted content will be sent to the wrong application
- When contacts have duplicate names, selecting with Enter alone may enter the wrong conversation
Reference files
scripts/wechat_auto.pyscripts/send_message