# google-messages > Send and receive SMS/RCS via Google Messages web interface (messages.google.com). Use when asked to "send a text", "check texts", "SMS", "text message", "Google Messages", or forward incoming texts to other channels. - Author: Niemand Assistant - Repository: kesslerio/google-messages-openclaw-skill - Version: 20260201000207 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/kesslerio/google-messages-openclaw-skill - Web: https://mule.run/skillshub/@@kesslerio/google-messages-openclaw-skill~google-messages:20260201000207 --- --- name: google-messages description: Send and receive SMS/RCS via Google Messages web interface (messages.google.com). Use when asked to "send a text", "check texts", "SMS", "text message", "Google Messages", or forward incoming texts to other channels. metadata: {"openclaw": {"emoji": "💬", "requires": {"tools": ["browser"]}}} --- # Google Messages Browser Skill Automate SMS/RCS messaging via messages.google.com using the `browser` tool. ## Overview Google Messages for Web allows you to send/receive texts from your Android phone via browser. This skill automates that interface. **Requirements:** - Android phone with Google Messages app - Phone and computer on same network (for initial QR pairing) - Browser profile with persistent session (use `openclaw` or your preferred profile) **Note:** Replace `profile=openclaw` in examples with your preferred browser profile if different. --- ## Quick Reference | Action | Command | |--------|---------| | Open pairing page | `browser action=open profile=openclaw targetUrl="https://messages.google.com/web/authentication"` | | Check session | `browser action=snapshot profile=openclaw` — look for conversation list vs QR code | | Take screenshot | `browser action=screenshot profile=openclaw` | --- ## Initial Setup (QR Pairing) First-time setup requires scanning a QR code: 1. **Open Google Messages Web** ``` browser action=open profile=openclaw targetUrl="https://messages.google.com/web/authentication" ``` 2. **Screenshot the QR code** and share with user ``` browser action=screenshot profile=openclaw ``` 3. **User scans with phone:** - Open Google Messages app on Android - Tap ⋮ menu → "Device pairing" → "QR code scanner" - Scan the QR code 4. **Verify connection** — snapshot should show conversation list, not QR code **Important:** Enable "Remember this computer" to persist the session. --- ## Sending Messages 1. **Navigate to conversations** ``` browser action=navigate profile=openclaw targetUrl="https://messages.google.com/web/conversations" ``` 2. **Take snapshot and find conversation** ``` browser action=snapshot profile=openclaw ``` Look for the contact in the conversation list, note the `ref`. 3. **Click conversation** ``` browser action=act profile=openclaw request={"kind": "click", "ref": ""} ``` 4. **Type message** (find textarea ref from snapshot) ``` browser action=act profile=openclaw request={"kind": "type", "ref": "", "text": "Your message"} ``` 5. **Click send** (find send button ref) ``` browser action=act profile=openclaw request={"kind": "click", "ref": ""} ``` --- ## Receiving Messages (Polling Approach) Due to browser sandbox restrictions, incoming message detection uses a polling approach rather than webhooks. ### How It Works 1. **Inject the observer script** into the Google Messages browser tab 2. **Observer watches** for new messages and stores them in memory 3. **Agent polls** periodically to check for pending notifications 4. **Forward notifications** to user's preferred channel ### Setup #### 1. Open Google Messages and inject observer After opening messages.google.com, inject the observer: ``` browser action=act profile=openclaw request={"kind": "evaluate", "fn": ""} ``` See `references/observer-polling.md` for the full observer script. #### 2. Poll for new messages Check for pending notifications: ``` browser action=act profile=openclaw request={"kind": "evaluate", "fn": "JSON.stringify(window._smsObserver ? window._smsObserver.getPending() : [])"} ``` Returns array of new messages: ```json [{"contact": "John", "preview": "Hey!", "time": "10:30 PM", "timestamp": 1234567890}] ``` #### 3. Forward to user For each pending message, send via OpenClaw: ``` message action:send channel:telegram target: message:"📱 SMS from : " ``` ### Cron Integration For automatic polling, add to HEARTBEAT.md or use a cron job: ``` Check Google Messages for new incoming SMS and notify me of any new messages. ``` The agent will poll the browser tab and forward notifications. --- ## Reading Messages See `references/snippets.md` for JavaScript snippets to: - Get recent conversations - Get messages in current conversation - Check session status --- ## Troubleshooting | Problem | Solution | |---------|----------| | QR code shown | Session expired, re-pair | | Elements not found | Google updated UI, check snapshot for new selectors | | Send button disabled | Message input empty or phone disconnected | | Observer not detecting | Check browser console for `[SMS Observer]` logs | | Tab lost | Re-open messages.google.com and re-inject observer | --- ## Selectors Reference Google Messages uses Angular components. These may change with updates. | Element | Selector | |---------|----------| | Conversation list | `mws-conversations-list` | | Conversation item | `mws-conversation-list-item` | | Message input | `textarea[aria-label*="message"]` | | Send button | `button[aria-label*="Send"]` | | QR code | `mw-qr-code` | --- ## Limitations - Phone must be online (messages sync through phone) - Browser tab must stay open for notifications - Session expires after ~14 days of inactivity - Observer lost on page reload (re-inject needed) - Polling approach has slight delay vs real-time --- ## Security - No external webhook server needed - Session stored in browser profile cookies - QR pairing links to your phone — treat as sensitive --- ## License Apache-2.0