I love Keyboard Maestro and use it for simple things. But I have something complex I need to do, but cannot figure out how best to accomplish it. I would be really grateful if somebody could help,
My daily workflow means that I paste bible scriptures into Microsoft Word continually. I have a service defined to pull the scriptures from my bible programme and insert them into Word.
The bible scriptures can only be exported with no formatting (this has been verified).
Here is the problem,,, each bible verse begins with a verse number. I need all those verse numbers to be superscript and it takes a long time to do this manually.
Can somebody help me figure out how to set up a macro in KM that enables me to convert any numbers in selected text in Word to superscript numbers, without affecting the rest of the text?
Here is an example. I want all the bible verses to be superscript!
Thank you for your help!
1 In the beginning God created the heavens and the earth. 2 The earth was without form, and void; and darkness was on the face of the deep. And the Spirit of God was hovering over the face of the waters. 3 Then God said, “Let there be light”; and there was light. 4 And God saw the light, that it was good; and God divided the light from the darkness. 5 God called the light Day, and the darkness He called Night. So the evening and the morning were the first day. 6 Then God said, “Let there be a firmament in the midst of the waters, and let it divide the waters from the waters.” 7 Thus God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament; and it was so. 8 And God called the firmament Heaven. So the evening and the morning were the second day.
Note that by applying any style, you necessarily get styled text, which means the font will be defaulted to something, probably Helvetica 12 so that will no longer simply take up the font/size of the target text like plain text would.
Sorry for replying to this old post, but just made a macOS service that does this. And was wondering if I should spend sometime converting it into an Keyboard Maestro action? https://bibleformat.webflow.io the macOS service is made with JXA so it should be possible to rewrite it if it's relevant?
You can in Microsoft Word using AppleScript, but using the clipboard will be more versatile across other applications that aren't AppleScriptable.
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/09/14 03:29
# dMod: 2021/09/14 03:29
# Appl: Microsoft Word
# Task: Get Selected Text
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Microsoft_Word, @Get, @Selected, @Text
--------------------------------------------------------
set theText to getSelectedTextFromWord()
--------------------------------------------------------
--» HANDLERS
--------------------------------------------------------
on getSelectedTextFromWord()
tell application "Microsoft Word"
return content of selection
end tell
end getSelectedTextFromWord
--------------------------------------------------------
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2021/02/12 13:24
# dMod: 2021/02/12 13:24
# Appl: Microsoft Word
# Task: Set Selection to Text
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Microsoft_Word, @Set, @Selection
--------------------------------------------------------
set theText to "Now is the time for all good men to come to the aid of their country."
setWordSelectionToText(theText)
--------------------------------------------------------
--» HANDLERS
--------------------------------------------------------
on setWordSelectionToText(theText)
tell application "Microsoft Word"
set content of selection to theText
end tell
end setWordSelectionToText
--------------------------------------------------------