I think I was just as confused as @Scott. Now that I re-read the question, or maybe I really read it for the first time and realized my original answer doesn't answer the question. I thought OP wanted the exported files to be named after the teams :/ I might delete this later, but I'll leave it in for now.
I still don't really understand what you want. What confuses me the most is how you say you want a text variable to change based on a filename. Do you mean the logo file? How does that relate to the custom messages in your spreadsheet. Like if "Name here" is replaced with
NFL-SSH-ETCHED.pdf, then enjoy your shirt (or whatever), Mr NFL-SSH-ETCHED.pdf ...Sorry your parents named you that.
The image in the post makes me think what you need is a simple csv file with the custom message and another column with a path to the image file, something like they have in this video, but I just can't wrap my head around your explanation.
If I wanted to change a text variable based on filenames, I'd likely copy files to clipboard and paste that to a spreadsheet application. On a mac pasting files to a text editor will just print out absolute paths to the files. Not sure if that works on Windows. Then I'd use find and replace to replace the path portion with nothing and now I have a spreadsheet with just the filenames that I could import to AI (as show in the video).
It might be easier to batch rename the files afterwards.
- You could use the
Filename (document name) + number config in AI's batch to make sure the output order mirrors the spreadsheet row order.
- Then you could use a batch renaming application to rename the files. It just needs to be able to rename files from a list:
How you could do it with
Better File Rename
While it does accept csv files as the input, I'm pretty sure it only understands plain text where each filename is in its own line, so you need to make a separate (.csv, .txt) for the renaming with just one column.
I didn't actually export any files from ai, I just made an example csv and forgot to add a header row...
Click to enlarge: