---
title: "Outdent action for ActionClip"
canonical_url: "https://actionclip.app/actions/outdent"
document_type: "standalone_action"
official: true
action_count: 1
catalog_schema_version: 1
catalog_revision: "2026-09-04.1"
catalog_published_at: "2026-09-04T10:30:00Z"
---

# Outdent action for ActionClip

Remove the shared indentation from selected lines.

## What it does

Remove the shared indentation from selected lines. It runs locally and handles the selected text without contacting a service.

## Action details

| Field | Value |
| --- | --- |
| Category | Text Editing & Formatting |
| Action type | JavaScript |
| Default result | Replace selected text by default |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **Outdent** — Selected text: one two three | one two three |

## How to remove the shared indentation from selected lines with ActionClip

1. Select the text you want to use.
2. Choose **Outdent** from ActionClip.
3. In editable text, ActionClip replaces the selection immediately. In read-only text, it opens the result for review and copying.

## Requirements

No setup required.

## Privacy

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

## Action script

````javascript
function run(selected_text) {
  var normalized = selected_text.replace(/\r\n?|\u2028|\u2029|\u0085|\u000B|\u000C/g, "\n");
  var lines = normalized.split("\n");
  var nonBlank = lines.filter(function (line) { return /\S/u.test(line); });
  if (nonBlank.length === 0) return normalized;
  var width = nonBlank.reduce(function (shortest, line) {
    var prefix = (line.match(/^[ \t]*/u) || [""])[0];
    return Math.min(shortest, prefix.length);
  }, Number.MAX_SAFE_INTEGER);
  if (!Number.isFinite(width) || width === 0) return normalized;
  return lines.map(function (line) { return /^\s*$/u.test(line) ? "" : line.slice(width); }).join("\n");
}
````

## Links

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