text-analyzer-script
by Filip Tammergård
Select a text and see data about it
// Menu: Analyze Text// Description: Select a text and see data about it// Author: Filip Tammergård// Twitter: @filipang// Shortcut: cmd opt shift control tconst { countCharacters, countWords, getReadingTime } = await npm("text-analyzer");const { getSelectedText } = await kit("text");const selectedText = await getSelectedText();const characters = countCharacters(selectedText);const words = countWords(selectedText);const readingTime = getReadingTime(selectedText);const readingTimeMinutes = readingTime.minutes;show(`<section style="margin:10px"><p>Characters: ${characters}</p><p>Words: ${words}</p><p>Reading time: ${readingTimeMinutes} minutes</p></section>`);