Problems / Questions regarding file preview

You don't need scripting for simple commands. See here for how to use them: