applescript – Parsing text, “line by line”, with automator

I’m very new to programming so pardon me if this is a very simple question, but I’m trying to create an automator workflow where the variable would change with each loop, pulling the inputs from a textedit document.

(and also, I’m creating the text edit document, so if formatting it differently would make this easier let me know)

For example, I have a text edit document with several numbers, all 3 digits, separated by line breaks, like this:


I’d like automator to run a workflow the first time with the variable as “001”, then again with variable as “005”, then a 3rd time as “009” and so on. And if it makes things easier I can format it to be all on one line separated by commas, surrounded by brackets, whatever is best.

I know a little bit of javascript and AppleScript, so if this is something solved with a run Javascript or AppleScript box, that is totally cool. Thanks!