---
title: "Hash Comment action for ActionClip"
canonical_url: "https://actionclip.app/actions/hash-comment"
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"
---

# Hash Comment action for ActionClip

Prefix every selected line with a hash comment.

## What it does

Prefix every selected line with a hash comment. It runs locally and handles the selected text without contacting a service.

## Action details

| Field | Value |
| --- | --- |
| Category | Developer Tools |
| Action type | JavaScript |
| Default result | Replace or copy text |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **Hash Comment** — Selected text: first second | # first # second |

## How to prefix every selected line with a hash comment with ActionClip

1. Select the text you want to use.
2. Choose **Hash Comment** 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 script

````javascript
function run(selected_text) {
  return selected_text.replace(/\r\n?|\u2028|\u2029|\u0085|\u000B|\u000C/g, "\n")
    .split("\n")
    .map(function (line) { return "# " + line; })
    .join("\n");
}
````

## Links

- [HTML listing](https://actionclip.app/actions/hash-comment)
- [Download action definition](https://actionclip.app/actions/hash-comment.actionclip)
- [Browse Developer Tools actions](https://actionclip.app/marketplace#marketplace-developerTools)
- [All Marketplace listings](https://actionclip.app/marketplace)
