It seems to me that automator/applescript would be the easiest. I've never played around with applescript however I do know that you can compile a script as standalone and then link to it in the startup items file. I'll see if I can cook something up for you.