Operating based if statement in an action script plus a bonus question

It took some rearranging but I finally got this thing working for Linux and its on hold for Windows so thank you all for your assistance.