| name | system-macro |
| description | Automate desktop operations via keyboard/mouse simulation and macros on Linux and macOS. Current support wechat-app send message |
System Macro
Simulate keyboard/mouse input and automate desktop application operations on Linux and macOS.
Supported Workflow
app-wechat
Send text and/or a file to a WeChat contact or group. WeChat must already be open and logged in.
Prefer the dispatcher unless you are debugging a platform-specific problem:
scripts/app-wechat.sh -r "<receiver>" -m "<message>" -f "<file-path>"
Before Running
- Confirm the exact
receiver, message, and optional file with the user.
- Warn the user not to touch the keyboard or mouse until the macro finishes.
- Verify WeChat is already running.
- Stop if both
message and file are empty.
- Use the platform-specific script only when the dispatcher is not appropriate.
Platform Requirements
- Linux:
xdotool, wmctrl, and clipboard support via xclip or xsel
- macOS:
osascript (built-in)
Behavior
- If the message is longer than 500 words, the script writes the content to a temporary file and sends the file instead of pasting text.
- Otherwise, it sends a trimmed text message.
- If
-f is provided, the file is sent before the text message.
- The dispatcher auto-detects Linux vs macOS.
- By default, a confirmation dialog appears before sending.
- Use
-c or --with-confirm-dialog to show the confirmation dialog.
Platform Scripts
- Linux:
scripts/app-wechat.linux.sh …
- macOS:
scripts/app-wechat.mac.sh …
Arguments
-r, --receiver — Contact or group name
-m, --message — Message text
-f, --file — Path to a file to send (optional)
-c, --with-confirm-dialog — Show confirmation dialog before sending
-C, --without-confirm-dialog — Skip confirmation dialog before sending (default)
-h, --help — Show usage
-v, --version — Show version
Recommended Flow
- Collect the exact receiver, message, and optional file path.
- Tell the user the macro will take control of the desktop briefly.
- Run
scripts/app-wechat.sh with quoted arguments.
- Report whether the command succeeded or failed.
Example
scripts/app-wechat.sh -r "#dev" -m "Build is green. Please review the latest changes."
With confirmation (automation mode):
scripts/app-wechat.sh -r "#dev" -m "Nightly deploy completed." -c