Yes, take a look at one of the starter solution such as the Invoice. You would have a script trigger OnFirstWindowOpen, which is under File, File Options, then a script triggers. This will run a script when your database first opens. The Invoice startup Script is Trigger | On First Window Open. There are script steps to detect the device and platform which is in the starter solution.