I should preface this with the fact that I have zero coding ability.
However, something I often have to do for blog posts and documents is title case my headings. I use this website https://titlecase.com which uses the APA style for title case. This requires me to type out my heading, convert it and copy it back to my document and then format it.
What I was wondering is if it would be possible to have a script on a button that when pressed would convert any selected text into title case using the following rules:
Capitalise the first word
Capitalise the first word after a colon, em dash, or end punctuation
Capitalise major words, including the second part of hyphenated major words (e.g., “Self-Report,” not “Self-report”)
Capitalise words of four letters or more (e.g., “With,” “Between,” “From”)
Lowercase only minor words that are three letters or fewer (except the first word or the first word after a colon, em dash, or end punctuation in a heading):
short conjunctions (e.g., “and,” “as,” “but,” “for,” “if,” “nor,” “or,” “so,” “yet”)
articles (“a,” “an,” “the”)
short prepositions (e.g., “as,” “at,” “by,” “for,” “in,” “of,” “off,” “on,” “per,” “to,” “up,” “via”)