← Back to context

Comment by yoavm

3 months ago

Interesting! The last time I used a Mac was many years ago, so I'm not sure what would you do with AppleScript in the browser. What are some example use cases?

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.