You click an element on a page
Runs the macro when you click an element on a page. The page still gets the click.
You click selector
Details #
Listens for clicks with a passive listener, so the site behaves exactly as it would without Switchboard. selector is matched against what you clicked and everything around it, so a click on the icon inside a button counts as a click on the button.
The run starts with the page's inputs plus selector, text and href (when the click was in a link).
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
selector | text | Yes | What to listen for. Required. | |
match | record | browser title url | Which pages. url is a pattern (https://*.github.com/*/pull/*), a plain start (github.com/apple) or /regex/; title is text (any case) or /regex/; browser is safari, chrome or any. |
Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.
Examples #
Count clicks on the buy button
When
- You click “text=Buy now” on a page on shop.example.com/*
Do
- Add 1 to shared.buyClicks
Gotchas #
It sees real clicks, not clicks a script made.