[GH-ISSUE #56] [Doubt]: How can I run custom scripts? #50

Open
opened 2026-03-03 16:43:29 +03:00 by kerem · 2 comments
Owner

Originally created by @AB-boi on GitHub (Feb 24, 2026).
Original GitHub issue: https://github.com/nickustinov/itsypad-macos/issues/56

So, in coteditor I use this script (AI generated):

#!/bin/bash
# %%%{CotEditorXInput=AllText}%%%
# %%%{CotEditorXOutput=ReplaceAllText}%%%

text=$(cat)
if command -v jq >/dev/null 2>&1 && [[ -n "$text" ]]; then
    printf '%s' "$text" | jq . --indent 2
else
    printf '%s' "$text"
fi

I run it manually to prettify json code pasted inside the editor. How can I achieve the same in itsypad? Is it possible?

Thanks in advance!

Originally created by @AB-boi on GitHub (Feb 24, 2026). Original GitHub issue: https://github.com/nickustinov/itsypad-macos/issues/56 So, in coteditor I use this script (AI generated): ```command #!/bin/bash # %%%{CotEditorXInput=AllText}%%% # %%%{CotEditorXOutput=ReplaceAllText}%%% text=$(cat) if command -v jq >/dev/null 2>&1 && [[ -n "$text" ]]; then printf '%s' "$text" | jq . --indent 2 else printf '%s' "$text" fi ``` I run it manually to prettify json code pasted inside the editor. How can I achieve the same in itsypad? Is it possible? Thanks in advance!
Author
Owner

@nickustinov commented on GitHub (Feb 25, 2026):

Hi, thanks for the suggestion!

Itsypad doesn't have a built-in script runner at the moment. This is somewhat related to #27 (AppleScript support), which would also enable this kind of workflow – getting editor text, piping it through a command, and putting it back.

For now, a workaround would be to use the clipboard via the terminal:

pbpaste | jq . --indent 2 | pbcopy

Then just paste the result back into Itsypad. Not as seamless as CotEditor's approach, but it gets the job done.

I might consider adding something like this if it gets more interest, but it's not a priority right now. Feel free to upvote #27 if you'd like to see scriptability happen!

<!-- gh-comment-id:3958359588 --> @nickustinov commented on GitHub (Feb 25, 2026): Hi, thanks for the suggestion! Itsypad doesn't have a built-in script runner at the moment. This is somewhat related to #27 (AppleScript support), which would also enable this kind of workflow – getting editor text, piping it through a command, and putting it back. For now, a workaround would be to use the clipboard via the terminal: ```bash pbpaste | jq . --indent 2 | pbcopy ``` Then just paste the result back into Itsypad. Not as seamless as CotEditor's approach, but it gets the job done. I might consider adding something like this if it gets more interest, but it's not a priority right now. Feel free to upvote #27 if you'd like to see scriptability happen!
Author
Owner

@AB-boi commented on GitHub (Feb 25, 2026):

Got it! Thanks for the tip. I agree that it’s not high priority!

<!-- gh-comment-id:3959420651 --> @AB-boi commented on GitHub (Feb 25, 2026): Got it! Thanks for the tip. I agree that it’s not high priority!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/itsypad-macos#50
No description provided.