Text Manipulation

This is a Toolkit for work with text. You can analyse selected text, get statistics, find and replace text, and modify it in various ways.

Lorem Ipsum Text Generator 🔧

Generate Lorem Ipsum text. You can choose between ... (Read more)

Tool: Lorem Ipsum Text Generator, Generate Lorem Ipsum text. You can choose between paragraphs, sentences and words, the number of units and the format (plain text / html). Video placeholderPlay Button

Text Case Converter 🔧

Transform the selected text to a different case. Y... (Read more)

Tool: Text Case Converter, Transform the selected text to a different case. You can choose from CamelCase, Capital Case, CONSTANT_CASE, dot.case, Header-Case, param-case, PascalCase, path/case, Sentence case, snake_case, Swap Case, Title Case, lower case, UPPER CASE, Upper Case First, and Sponge Case. Video placeholderPlay Button

Duplicate Text 🔧

Duplicate the selected text by replacing a word wi... (Read more)

// Author: Eduard Uffelmann
// Linkedin: https://www.linkedin.com/in/euffelmann/
// Twitter: @schmedu_
// Website: https://schmedu.com

import "@johnlindquist/kit";

let input = await getSelectedText();

let buildPreview = ([search, replacement]) => {
    if (!search) return md(input);
    if (!replacement)
        return md(
            `${input
                .replaceAll("\n", "<br>")
                .replaceAll(search, `<ins>${search}</ins>`)}`
        );
    return md(
        `${input}
${replacement
            .split(",")
            .map((item) => {
                return input
                    .replaceAll("\n", "<br>")
                    .replaceAll(search, `<ins>${item}</ins>`);
            })
            .join("<br>")}`
    );
};

let [search, replacement] = await fields({
    fields: ["Search", "Replacement"],
    preview: buildPreview(["", ""]),
    onChange: async (input, state) => {
        let preview = buildPreview(state?.value);
        setPreview(preview);
    },
});

let result = `${input}
${replacement
        .split(",")
        .map((item) => {
            return input.replaceAll(search, `${item}`);
        })
        .join("\n")}`;

// Output
await setSelectedText(result);

Get Text Length 🔧

Return the length of the selected text.

Tool: Get Text Length, Return the length of the selected text. Video placeholderPlay Button

Get Reading Time of Text 🔧

How much time does the text take to read? Just sel... (Read more)

Tool: Get Reading Time of Text, How much time does the text take to read? Just select the text in any application and run this script. Video placeholderPlay Button

Replace Text 🔧

Replace text in the selected text.

Tool: Replace Text, Replace text in the selected text. Video placeholderPlay Button

Text Word Count 🔧

Counts the words in the selected text. It's a simp... (Read more)

Tool: Text Word Count, Counts the words in the selected text. It's a simple algorithm that counts the spaces between words. Video placeholderPlay Button

Title Case 🔧

Convert the selected text to title case.

Tool: Title Case, Convert the selected text to title case. Video placeholderPlay Button

Get The Toolkit Now!

You can install the 'Text Manipulation' Toolkit now and start using it today! It's free!