← 返回
沟通协作

WeChat Send

Automate sending text messages and images/files in the macOS WeChat desktop app by controlling the UI via AppleScript and JXA. This is NOT a WeChat chat chan...
通过 AppleScript 和 JXA 控制 macOS 微信桌面版界面,自动发送文本、图片及文件。注意:这不是微信聊天频道...
yeholdon
沟通协作 clawhub v1.0.0 1 版本 99866.5 Key: 无需
★ 0
Stars
📥 748
下载
💾 21
安装
1
版本
#latest

概述

WeChat Send

Send messages to WeChat contacts by automating the macOS WeChat desktop app.

Prerequisites

  • WeChat for Mac installed and logged in
  • macOS Accessibility permission granted to node (System Settings → Privacy & Security → Accessibility)
  • WeChat window must be open (not minimized to dock)

Usage

Run the scripts:

# Send text
bash scripts/wechat_send.sh "<contact_name>" "<message>"

# Send an image (or any file attachable by WeChat)
bash scripts/wechat_send_image.sh "<contact_name>" "/path/to/image.png"

Examples

# Send a simple message
bash scripts/wechat_send.sh "Ryan" "你好!"

# Send a longer message
bash scripts/wechat_send.sh "Ellison" "明天下午3点开会,别忘了带文件"

# Send a screenshot
bash scripts/wechat_send_image.sh "Family" "/Users/you/Desktop/screen.png"

How It Works

  1. Activates WeChat and opens search (Cmd+F)
  2. Types the contact name, selects the first result (Enter), closes search (Escape)
  3. Clicks the message input field using JXA CGEvent mouse simulation
  4. Pastes the message from clipboard (Cmd+V) and sends (Enter)

Limitations

  • Contact name must exactly match a WeChat contact (first search result is selected)
  • Image/file sending depends on WeChat accepting paste-from-clipboard as an attachment (works for common formats like PNG/JPG)
  • Cannot read incoming messages
  • WeChat window position affects click coordinates (auto-calculated from window bounds)
  • If the contact search returns wrong results, the message goes to the wrong person — use specific names
  • Only one message at a time; for multiple recipients, call the script multiple times

Troubleshooting

  • Message not sent: Ensure WeChat window is visible (not minimized) and the correct contact was found
  • Accessibility error: Re-grant node permission in System Settings → Accessibility, then restart the gateway
  • Wrong contact: Use a more specific name to avoid ambiguous search results

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-20 07:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,596

Image Compression

yeholdon
自动压缩超过Telegram 10MB限制的图片,调整宽度和质量,并以新文件名保存原始文件。
★ 0 📥 611
communication-collaboration

Slack

steipete
当需要通过 slack 工具从 Clawdbot 控制 Slack 时使用,包括在频道或私信中回复消息或置顶/取消置顶项目。
★ 157 📥 47,688