mac-clipboard — Clipboard Read/Write
Reads and writes macOS clipboard contents using pbcopy and pbpaste.
Usage
# Read current clipboard contents
python3 mac_clipboard.py
# Write text to clipboard
python3 mac_clipboard.py "Hello, world!"
# Write with explicit -w flag
python3 mac_clipboard.py -w "text to copy"
How it works
- Read: calls
pbpasteand prints clipboard contents to stdout - Write: pipes text to
pbcopyvia stdin
Example output
📋 当前剪贴板内容:
Hello, world!
On successful write:
✅ 已写入剪贴板