Goal
Call scripts/send_qingtui_message.swift, and send a plain text message to a specified contact in the macOS Qingtui desktop app.
Required parameters
contact: The contact display name, which must exactly match the Qingtui conversation title.message: The plain text content to send.
Prerequisites
- The Qingtui desktop app is installed.
- The current terminal or Codex has been granted macOS Accessibility permission.
- It is recommended to also grant Screen Recording permission, because the script takes screenshots and uses OCR to verify the contact and message.
- Only text messages are supported; images, files, and cards are not supported.
Workflow
- Validate that
contactandmessageare non-empty. - Run the script:
swift scripts/send_qingtui_message.swift --contact "<contact>" --message "<message>"
- The script will automatically:
- Open or activate Qingtui.
- Focus the search box in the upper-left corner and search for the contact.
- Use OCR to find an exact match among the search results.
- After opening the conversation, verify again that the title exactly equals
contact。 - After verification passes, write the text into the input area and press Enter to send.
Debugging
- Only verify locating, without actually sending:
swift scripts/send_qingtui_message.swift --contact "<contact>" --message "<message>" --dry-run
Safety rules
- Only exact title matches are accepted; no fuzzy guessing is performed.
- If the contact cannot be found, permissions are insufficient, screenshot capture fails, OCR verification fails, or the interface structure is abnormal, report an error directly and stop.
- Qingtui is currently a Chrome App wrapper interface, and the script depends on the current desktop layout; if Qingtui undergoes a major version redesign, the script must be updated accordingly.