wechat-send

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WeChat Send

WeChat Send

概览

Overview

这个 skill 用来在 macOS 桌面版微信里发送消息,优先走稳定的 UI 自动化顺序:
  1. 激活 WeChat 并确认它是前台应用
  2. 用快捷键打开搜索或切换会话
  3. 联系人名和消息正文都通过剪贴板粘贴,避免输入法拦截
This skill is used to send messages in the desktop version of WeChat on macOS, following a stable UI automation sequence:
  1. Activate WeChat and confirm it is the foreground application
  2. Use keyboard shortcuts to open search or switch conversations
  3. Both the contact name and message content are pasted via the clipboard to avoid input method interception

何时使用

When to Use

  • 用户明确要求在 macOS 微信客户端给联系人发消息
  • 直接键入中文容易被输入法干扰,必须改用剪贴板粘贴
不要在这些场景优先使用这个 skill:
  • 用户只是要发网页微信消息
  • 目标环境不是 macOS 桌面
  • When users explicitly request to send messages to WeChat contacts via the macOS WeChat client
  • When typing Chinese directly is prone to input method interference and must be replaced with clipboard pasting
Do not prioritize this skill in these scenarios:
  • Users only need to send messages via Web WeChat
  • The target environment is not a macOS desktop

前置依赖

Prerequisites

  • macOS 已安装并登录 WeChat
  • 运行环境已授予 Accessibility 权限
  • WeChat is installed and logged in on macOS
  • The runtime environment has been granted Accessibility permissions

标准工作流

Standard Workflow

1. 先做依赖体检

1. Dependency Check First

bash
python3 scripts/wechat_auto.py doctor
这个检查会确认:
  • WeChat
    是否可启动
  • osascript
    pbcopy
    pbpaste
    是否可用
任一必需项缺失时,命令会输出错误并以非 0 退出。
bash
python3 scripts/wechat_auto.py doctor
This check will confirm:
  • Whether
    WeChat
    can be launched
  • Whether
    osascript
    ,
    pbcopy
    ,
    pbpaste
    are available
If any required item is missing, the command will output an error and exit with a non-zero code.

2. 直接发送消息

2. Send Messages Directly

从 skill 根目录执行:
bash
scripts/send_message "文件传输助手" "测试消息"
需要调试信息时:
bash
python3 scripts/wechat_auto.py send "文件传输助手" "测试消息" --debug --delay 0.8
Execute from the skill root directory:
bash
scripts/send_message "File Transfer Assistant" "Test Message"
When debugging information is needed:
bash
python3 scripts/wechat_auto.py send "File Transfer Assistant" "Test Message" --debug --delay 0.8

快速命令

Quick Commands

  • 体检:
bash
python3 scripts/wechat_auto.py doctor
  • 发送消息:
bash
scripts/send_message "张三" "你好,这是自动消息"
  • Dependency Check:
bash
python3 scripts/wechat_auto.py doctor
  • Send Message:
bash
scripts/send_message "Zhang San" "Hello, this is an automated message"

常见风险

Common Risks

  • 没有 Accessibility 权限时,快捷键会失败
  • 微信未在前台时,粘贴内容会发到错误应用
  • 联系人重名时,单靠回车选中可能进入错误会话
  • Keyboard shortcuts will fail if Accessibility permissions are not granted
  • Pasted content will be sent to the wrong application if WeChat is not in the foreground
  • If there are duplicate contact names, selecting with just the Enter key may open the wrong conversation

参考文件

Reference Files

  • scripts/wechat_auto.py
  • scripts/send_message
  • scripts/wechat_auto.py
  • scripts/send_message