Before you write your action, open the shape you have in Photoshop and make a selection out of it. Under selection go to save selection.
Now when you write the action, as part of the script, when your ready to make selection, go under selection to load selection. This will make a selection out of the shape you have. Play with that, I believe you'll need to keep the selection document open while you run your batch. If you want to add the out line, create the line as a seperate document and save that as another selection and fill the selection when writing your script. You may need to batch the files twice. I don't know if you can use two selections in the batch.
I just did a test in PS 6 and it worked fine. As always, run a few tests before trying to batch all your files