---
title: "Clean Lines action for ActionClip"
canonical_url: "https://actionclip.app/actions/clean-lines"
document_type: "standalone_action"
official: true
action_count: 1
catalog_schema_version: 1
catalog_revision: "2026-08-21.1"
catalog_published_at: "2026-08-20T18:50:00Z"
---

# Clean Lines action for ActionClip

Trim lines and remove empty ones from selected text.

## What it does

Removes blank lines and trims surrounding whitespace while preserving the order of the remaining lines.

## Action details

| Field | Value |
| --- | --- |
| Category | Text Editing & Formatting |
| Action type | JavaScript |
| Result | Replace or copy text |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **Clean Lines** — Selected text: Prepare launch checklist Confirm pricing slide | Prepare launch checklist Confirm pricing slide |

## How to trim lines and remove empty ones from selected text with ActionClip

1. Select the text you want to use.
2. Choose **Clean Lines** from ActionClip.
3. Review the result, then replace the selection or copy the new text.

## Requirements

No setup required.

## Privacy

Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

## Action configuration

````javascript
function run(selected_text) {
  return selected_text
    .split(/\r\n?|\n/)
    .map((line) => line.trim())
    .filter((line) => line.length > 0)
    .join("\n");
}
````

## Links

- [HTML listing](https://actionclip.app/actions/clean-lines)
- [Download action definition](https://actionclip.app/actions/clean-lines.actionclip)
- [Browse Text Editing & Formatting actions](https://actionclip.app/marketplace#marketplace-textTools)
- [All Marketplace listings](https://actionclip.app/marketplace)
