Extract the username from an email in RunMacro
Desktop ModeRunMacro 3.5+
The Extract Email Username command reads the email in the clipboard, takes the part before @ (the username), and writes the result back to the clipboard.
Dialog & quick setup

- Put the email in the clipboard (Copy Text from the email field, or Set Clipboard).
- Add a Keyboard › Extract Email Username command.
- Save. After running, the clipboard holds the username; use Paste from Clipboard to fill it.
Modes & when to use
Desktop Mode
Best for
- Generate usernames from a list of emails.
- Process bulk email data in a sign-up workflow.
- Take the name part to fill a "username" field.
Use an alternative when
- Do not use it for full email parsing, multiple addresses, display names, or plus-addressing that must be preserved.
Before you run
- Add Extract Email Username to the macro.
- Prepare the data or target that Extract Email Username will use.
Example workflow
Example: fill a username from an email
- Set Clipboard =
john@gmail.com. - Extract Email Username → clipboard becomes
john. - Click the username field, Paste from Clipboard.
Expected result: After execution, Extract Email Username completes the described action and makes its result available to the next step.
Tips & limitations
If the clipboard has no
@, the command leaves the content as-is and logs a note.- It takes the part before @ and overwrites the clipboard; empty or malformed input can produce an empty username.
Applies to RunMacro 3.5+ · Desktop Mode · Windows 10/11
