I guess you want to store a file and print it as easily as possible, So one solution is save it as "init.g". That gets executed as soon as you mount sd card. So if you had it in your pc automount will do it and on startup it will also get started. So if you want it executed have card inserted, otherwise not inserted,