Navigation
Search
|
How To Use an Automator To Convert Text To Title Case?
Wednesday May 19, 2021. 05:19 PM , from MacMost
I’m a new Automator user. Using Automator and a javascript action, I’m attempting to convert the selected text to a Title case in desktop WhatsApp application where the contextual menu with Transformations – capitalize doesn’t show. However, it always comes with the error and posted below. Please assist me in resolving the issue. The following is the Javascript code in detail:
Javascript Code —————– function run(input, parameters) { const patternStyle = /^w|[s.]w/gm; input = input.replace(patternStyle, element => element.toUpperCase()); return input; } Error While Executing ————————– Execution Error Error: TypeError: input.replace is not a function. (In ‘input.replace (patternStyle, element E> element.toUpperCase ())’, ‘input.replace’ is undefined) 1. I have set up as a quick action under Automator with Workflow receives current text->in any application and Input is entire selection followed by Output replaces the selected text 2. Automator has only one action and it is Run Javascript Action with the above-posted code —– Kishore Kumar
https://macmost.com/forum-how-to-use-an-automator-to-convert-text-to-title-case.html
|
46 sources
Current Date
Apr, Mon 29 - 22:11 CEST
|