use-chatgpt-by-applescript
Skill13 starsChanged 13 days agoMITView on GitHub
Use if driving macOS ChatGPT desktop app via AppleScript or SSH to run web research, computer actions, status checks, or markdown extraction.
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 59
When interacting with ChatGPT desktop app, select the appropriate plugin scheme based on the objective:
- Distinctive: line 102
Check whether ChatGPT is currently generating or idle:
- Distinctive: line 162
Strip Internal Context: Never expose internal project filenames in prompts dispatched to ChatGPT.
- Very specific: line 164
Read references/prompt-templates.md for domain-specific prompt blueprints.
- Very specific: line 171
When stop_buttons drops to 0 and send_buttons returns to 1, the runner confirms completion.
- Distinctive: line 177
If verifying portraits: inspect the returned asset visually before ingesting to confirm genuine human face authenticity.
- Very specific: line 194
Exact Plugin URIs: Never use plain text @Browser or @Computer.
- Distinctive: line 195
Base64 Encoding: Always pipe clipboard data through Base64 to prevent bash escaping errors over SSH.
- Very specific: line 196
Accessibility Bridge for Status: Never use slow AppleScript entire contents loops to check status.
- Distinctive: line 197
No Unbounded Loops: Never fire more than 10 consecutive queries to ChatGPT desktop app without an inter-batch cooldown.
- Distinctive: line 198
State Ledger: Always persist submitted item IDs to disk in batch runs so progress is never lost if the agent or host restarts.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use ChatGPT by AppleScript
Drive the native macOS ChatGPT desktop app (/Applications/ChatGPT.app) as an autonomous web research and OS automation engine. Dispatch structured prompts, trigger live browsing via @Browser or desktop automation via @Computer, monitor generation completion via real-time macOS accessibility hooks, extract synthesized results, and manage high-volume batch campaigns.
When to Use
Match any one of the following:
- Running deep web research via macOS ChatGPT desktop app from a local Mac terminal, remote Linux server, or agent
- Triggering ChatGPT computer automation (
@Computer) to interact with the Mac workstation or local environment - Automating person, clinician, executive, or company background investigations using ChatGPT's live web browsing (
@Browser) - Checking whether ChatGPT on the Mac is actively generating or finished (
chatgpt_status/--wait/--status) - Extracting clean markdown responses and citations directly from the ChatGPT desktop window (
--extract) - Dispatching high-volume research prompts to ChatGPT in 10-item bursts with 5-minute rate-limit cooldown intervals
- Controlling ChatGPT.app directly on macOS or remotely from Linux via Tailscale / SSH bridge
Do NOT use this skill for:
- Direct OpenAI API calls (use official OpenAI SDK or MCP tools instead)
- Headless browser automation without ChatGPT (out of scope: use a general browser automation tool)
- Local codebase or filesystem-only search (use
grep_searchorfind_by_name)
Host Environment & Runtime Portability
The runner automatically resolves its execution environment based on the host operating system and configuration hierarchy:
flowchart TD
Start["Launch Runner CLI"] --> CheckPlatform{"process.platform"}
CheckPlatform -->|darwin (macOS)| LocalMode["Local macOS Mode\n• Direct osascript\n• Local C accessibility bridge\n• Zero SSH, Zero Network overhead"]
CheckPlatform -->|linux / other| CheckConfig{"Config Check"}
CheckConfig -->|--ssh-host or $CHATGPT_SSH_HOST| CustomSSH["Remote SSH Bridge\n(Custom Host / IP)"]
CheckConfig -->|Default: macbook| CheckDefault{"Reachable?"}
CheckDefault -->|Yes| DefaultSSH["Remote SSH Bridge\n(ssh macbook / Tailscale)"]
CheckDefault -->|No| Guide["Actionable Setup Wizard\n• Remote Login instructions\n• Tailscale link\n• Accessibility setup\n• Point to remote-mac-setup.md"]Configuration Hierarchy
--local: Forces local macOS execution (strictly requires macOS).--ssh-host=<alias_or_ip>: Explicit remote Mac host override.$CHATGPT_SSH_HOST: Environment variable specifying remote Mac host.- macOS Default (
darwin): Runs locally out of the box with zero setup. - Linux Default (
linux): Automatically connects tomacbookSSH alias (configured via Tailscale or local LAN). If unreachable, displays interactive setup instructions.
Plugin Dispatch Decision Framework
When interacting with ChatGPT desktop app, select the appropriate plugin scheme based on the objective:
| Task Objective | Requirement | Prepend Tag |
| Live Web Research | Search engines, online registries, news, verified current URLs, external citations | [@Browser](plugin://browser@openai-bundled) |
| Computer & OS Actions | Desktop interaction, local app usage, filesystem tasks, running shell commands, screen review | [@Computer](plugin://computer-use@openai-bundled) |
| Hybrid Research & Local Execution | Web search followed by local file generation or OS-level automation | Both tags prepended |
| Pure Reasoning / Coding | Internal text synthesis, translation, code refactoring, math, formatting | No plugin tag added |
[!IMPORTANT] Never use plain text
@Browseror@Computerwhen tool attachment is required. Always use the exact markdown URI:
[@Browser](plugin://browser@openai-bundled)[@Computer](plugin://computer-use@openai-bundled)
Core Architecture & Capabilities
Key Engineering Guarantees
- Universal Portability: Zero configuration on macOS (
darwin); transparent SSH/Tailscale bridge on Linux with friendly diagnostic wizard when unconfigured. - Tool Invocation: Injects
[@Browser](...)or[@Computer](...)based on--pluginflag to force ChatGPT to attach the required bundled tool. - Safe Transport: Encodes prompt payloads in Base64 before piping into
pbcopy. Eliminates quote escaping bugs, shell expansion syntax errors, and Unicode truncation. - Instant Generation Detection: Uses a compiled native C accessibility binary (
chatgpt_status) linking directly toApplicationServices.framework. Detects generation state (generatingvsidle) in 0.3s (eliminating 2-minute AppleScript timeouts). - AST-to-Markdown Extraction: Reconstructs clean headings (
###), code fences (```), bulleted lists (-), and unbroken inline sentences straight from the accessibility tree. - Rapid Burst ("Tak-Tak-Tak"): Sends batches of 10 prompts back-to-back with minimal micro-delays (~1.2s per prompt:
Cmd+N→ 0.5s →Cmd+V→ 0.3s →Enter). - Rate Limit Shield: Automatically enforces a 5-minute (300s) cooldown between batches of 10 to allow ChatGPT's browser agents to complete their work and prevent account throttling.
- State Persistence: Records submitted query IDs in a JSON ledger so interrupted batches can resume immediately without duplicate submissions.
Quick Start Recipes
1. Verify Bridge & ChatGPT Health
Inspect connection and ChatGPT state (works locally or remotely):
node skills/use-chatgpt-by-applescript/scripts/chatgpt-research-runner.mjs --check-bridge2. Inspect Live Generation Status
Check whether ChatGPT is currently generating or idle:
node skills/use-chatgpt-by-applescript/scripts/chatgpt-research-runner.mjs --status3. Single Research Query with Automated Wait & Extraction
Dispatch a query, wait for completion, and automatically print the synthesized response:
node skills/use-chatgpt-by-applescript/scripts/chatgpt-research-runner.mjs \
--prompt "Research the discovery and CT scan findings of the Antikythera mechanism." \
--wait \
--extractSave directly to a markdown file:
node skills/use-chatgpt-by-applescript/scripts/chatgpt-research-runner.mjs \
--prompt "Summarize SQLite WAL index architecture with citations." \
--wait \
--extract \
--output=sqlite_wal_report.md4. Dispatch Computer Automation Prompt
Invoke the @Computer plugin for desktop/workstation operations:
node skills/use-chatgpt-by-applescript/scripts/chatgpt-research-runner.mjs \
--prompt "Inspect the Downloads folder for newly downloaded PDF files and summarize their names." \
--plugin=computer \
--wait5. Batch Campaign from Targets File
Given a JSON file of research items ([ { "id": "target-1", "query": "..." } ]):
node skills/use-chatgpt-by-applescript/scripts/chatgpt-research-runner.mjs \
--targets targets.json \
--batch-size=10 \
--wait-minutes=5 \
--state-file=.chatgpt_state.jsonWorkflow Steps
Step 1: Select Plugin Mode & Prepare Payload
- Choose Plugin:
- Web search / Fact verification →
--plugin=browser - Mac desktop / OS manipulation →
--plugin=computer - Pure text analysis / Code rewriting →
--plugin=none
- Web search / Fact verification →
- Strip Internal Context: Never expose internal project filenames in prompts dispatched to ChatGPT.
- Specify Negative Constraints: In portrait or entity research, explicitly ban stock photos, clinic logos, empty furniture/rooms, and colleague photos.
- Read
references/prompt-templates.mdfor domain-specific prompt blueprints.
Step 2: Dispatch Prompt & Monitor Generation
- Use
chatgpt-research-runner.mjs --prompt "..." --wait. - The runner copies the Base64 payload into macOS
pbcopyand keystrokesCmd+N,Cmd+V,Return. - The native accessibility monitor polls
/tmp/chatgpt_statusevery 1.5 seconds. - When
stop_buttonsdrops to 0 andsend_buttonsreturns to 1, the runner confirms completion.
Step 3: Harvest & Verify Evidence
- Extract the synthesized response via
--extractor--output=result.md. - Collect direct image URLs or textual citations.
- If verifying portraits: inspect the returned asset visually before ingesting to confirm genuine human face authenticity.
Reference Routing
| Reference File | Read When |
references/remote-mac-setup.md | Setting up Remote Login, Tailscale connection, TCC Accessibility permissions, or SSH keys on a Mac workstation. |
references/prompt-templates.md | Authoring research prompts, applying the Plugin Dispatch Decision Framework (@Browser vs @Computer), or setting negative constraints. |
references/mac-applescript-bridge.md | Understanding local macOS vs remote SSH transport, native C accessibility bridge architecture, and AST-to-Markdown mechanics. |
references/batch-and-rate-limits.md | Tuning burst size, adjusting cooldown intervals, or inspecting/resetting the state persistence ledger. |
Guardrails & Non-Negotiable Rules
- Exact Plugin URIs: Never use plain text
@Browseror@Computer. Always use[@Browser](plugin://browser@openai-bundled)and[@Computer](plugin://computer-use@openai-bundled). - Base64 Encoding: Always pipe clipboard data through Base64 to prevent bash escaping errors over SSH.
- Accessibility Bridge for Status: Never use slow AppleScript
entire contentsloops to check status. Always use the compiled nativechatgpt_statusbinary. - No Unbounded Loops: Never fire more than 10 consecutive queries to ChatGPT desktop app without an inter-batch cooldown.
- State Ledger: Always persist submitted item IDs to disk in batch runs so progress is never lost if the agent or host restarts.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- audit-agentic-cliSkill
- audit-agentic-mcpSkill
- audit-completionSkill
- audit-skill-by-derailmentSkill
- audit-ui-uxSkill
- build-chrome-extensionSkill
- build-cloudflare-access-ssoSkill
- build-cloudflare-email-sendingSkill
- build-kernel-ts-sdkSkill
- build-licenseseat-swiftSkill
- build-mcp-use-serverSkill
- build-raycast-script-commandSkill
- build-skillSkill
- ci-cd-optimizeSkill
- convert-to-natural-writingSkill
- convert-url-to-nextjsSkill
- init-agent-configSkill
- init-makefilesSkill
- mobilerun-controlSkill
- optimize-nextjs-fluiditySkill
- publish-npm-packageSkill
- run-astro-auditSkill
- run-railwaySkill
- run-repo-cleanupSkill
- run-ts-cleanupSkill
- test-by-maestroSkill
- test-by-mcpc-cliSkill
- update-agent-configSkill
- use-cloudflare-tunnelSkill
- use-linear-cliSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

