Text Editing & Formatting

Extract Email Addresses

Extract unique email addresses from selected text.

OfficialOn-device

Download action

What Extract Email Addresses does

Finds conventional email addresses, removes case-insensitive duplicates, and returns one address per line without sending the selection anywhere.

CategoryText Editing & Formatting
Action typeJavaScript
ResultCopy the result
InternetNot required

Action and outcome

Extract Email Addresses example
ActionOutcome
Extract Email AddressesSelected text: Email [email protected] or [email protected]; [email protected] is the same contact.[email protected] [email protected]

Use Extract Email Addresses

Follow these steps to extract unique email addresses from selected text with ActionClip.

  1. Select the text you want to use.
  2. Choose Extract Email Addresses from ActionClip.
  3. Review the result, then copy it where you need it.

Requirements and privacy

  • Before you start: No setup required.
  • Your selected text: Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

Action configuration

The definition below is included so you can inspect how the action works before downloading it.

JavaScript definition
function run(selected_text) {
  const matches = selected_text.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi) || [];
  const seen = new Set();
  const emails = [];
  matches.forEach((email) => {
    const key = email.toLowerCase();
    if (!seen.has(key)) {
      seen.add(key);
      emails.push(email);
    }
  });
  return emails.length ? emails.join("\n") : "No email addresses found.";
}