What is the "Text Script" action?
The Text script action allows you to interact with elements on a webpage simply by typing what you see on the screen. Instead of worrying about complex HTML selectors or code, you can use plain English to tell Monity what to click.
This action is perfect for clicking buttons, links, or tabs when you know the exact text they display.
Basic Usage
The most common way to use a Text script is to command Monity to click on specific text. The basic syntax is:
click "Your Text Here"
Example: If you want to click a button that says "Log In", your script would simply be:
click "Log In"
Running Multiple Steps
You can execute multiple clicks in a single Text script action by separating them with a comma or placing them on new lines.
click "Log In", click "Dashboard", click "Settings"
Scoping Clicks ("in" keyword)
Webpages often contain repetitive blocks of content, like product cards or price tables. If you need to click a specific button inside a specific block, you can use the in keyword to limit where Monity searches.
Syntax:
click "Target Text" in "Container Text"
Example: Imagine a pricing page with multiple columns, and each column has a "Buy Now" button. To click the "Buy Now" button specifically inside the "Pro Plan" column, use:
click "Buy Now" in "Pro Plan"
Monity will first locate the area containing "Pro Plan" and then strictly search for "Buy Now" within that area.
Important Formatting Rules
- Quotes are required: Always wrap your target text and scope text in double
" "or single' 'quotes. - Case-insensitive: Text scripts ignore capitalization.
click "pricing"will successfully match a button that says "PRICING". - Partial matches: If the exact text isn't found, the script will automatically fallback to look for an element that contains your text.
Top Articles
71 Shelton Street, Covent Garden, London, WC2H9JQ United Kingdom
© Copyrights Monity.ai, 2025, Inc.