Comment by latexr

3 months ago

Just so we’re on the same page, you use AppleScript outside the browser, but it interacts with the browser. Some basic use cases:

- Change to first browser tab whose URL or title matches <whatever>.

- Close every browser tab matching <whatever>.

- Grab all your tabs and backup their URLs to a file.

- Join all tabs from all windows into a single window.

- Execute JavaScript on a page and get results back.

- Grab the URL of the current tab and open it in a different browser in a Private window.

- And many more things.

Those are browser automation tasks. Most of them can be done with Playwright/Puppeteer/Selenium.

I don't see why a browser should have to support AppleScript specifically. The Chrome DevTools Protocol and WebDriver BiDi are the standard protocols for interacting with browsers programmatically. Firefox supports WebDriver BiDi. Just use any tool that supports it, or talk to it directly. Maybe AppleScript can do that, I wouldn't know.

  • No, those are not the same thing. The capabilities and integrations are different, and AppleScript works in a vanilla installation.

Just wait until someone has the bright idea to expose Apple Events over an MCP server or something. Then everyone will be scrambling to integrate applescript into their applications so they can cash in on the computer-use model craze.

  • I'm really surprised no one has done this.

    You don't even need an mcp server. Claude Code can just run osascript. https://news.ycombinator.com/item?id=44492369

    • Directly writing applescript is kind of terrible syntax (I doubt there is enough high quality data, even humans find it hard to write) and lacks the discoverability portion. The good part of AppleScript is the self-discovery (via scripting dictionary) and the general graphql-RPC-esque nature of apple events.