[Command] Name=\x81ea\x52a8\x5408\x5e76\x6362\x884c Command=" copyq: function isAlphaNumeric(s) { return /^[a-zA-Z0-9]+$/.test(s); } function mergeLinesIntoParagraph(text) { const paragraphEndFlags = ['.', '!', '?', '\xff1f', '\xff01', '\x3002']; const lines = text.split('\\n').map(str => str.trim()).filter(str => str !== ''); const paragraphs = []; var currentParagraph = ''; for (var i = 0; i < lines.length; i++) { const line = lines[i]; const lastChar = line.charAt(line.length - 1); const isEndOfSentence = paragraphEndFlags.indexOf(lastChar) > -1; currentParagraph += line + (isAlphaNumeric(lastChar) ? ' ' : ''); if (isEndOfSentence) { paragraphs.push(currentParagraph.trim()); currentParagraph = ''; } } paragraphs.push(currentParagraph.trim()); const mergedText = paragraphs.join('\\n'); return mergedText; } var mytext = str(clipboard('text/plain')); if (mytext) { tab(selectedtab()); myindex = index() + 1; write(myindex, 'text/plain', mergeLinesIntoParagraph(mytext)); select(myindex); paste(); } " Icon=\xf15b