Want to convert text..... to initials to help me learn verbatim

Hi there

This might seem random but I’m searching for a way to rapidly and easily convert a chunk of text to the only the initials. I’m training to become an air traffic controller and in the UK we are required to learn huge chunks of text verbatim, i.e. word for word, off by heart. A good way to do this is to begin with just using the initials of the words as a prompt whilst you remember the words they stand for.

Ideally I’d need the script to maintain capitalization and punctuation, carriage returns, bullet points and numbers, and only touch the words themselves.

Would this be too hard for someone to knock up in a few minutes? I’d massively appreciate any help. I’m no scripter so don’t even know where to start.

I hope you don’t think I’m being cheeky by just asking for help - I’m just in desperate need of assistance. Many thanks.

P.S. I found a javascript app on a website that does something similar but it crops all my numbers, which as you can imagine, are vitally important when it comes to controlling aeroplanes :wink:

An example:

Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.

F s a s y a o f b f o t c, a n n, c i L, a d t t p t a m a c e.

Try something like this:

property defaultAnswer : ""

display dialog "Shorten this text:" default answer defaultAnswer
set defaultAnswer to text returned of result

do shell script "echo " & quoted form of defaultAnswer & " | /usr/bin/ruby -e \"puts STDIN.read.gsub(/([^a-z]?[a-z])[a-z']+/i, '\\1')\""
set shortenedText to result

display dialog shortenedText buttons {"Copy to Clipboard", "OK"} default button 2

if button returned of result is "Copy to Clipboard" then
	set the clipboard to shortenedText
end if

It works brilliantly, thank you!

I really appreciate your generosity, this will make such a difference to my learning. Many thanks.