Yes. Just like that.
How can I tell FileMaker to run a script based on if you are using a solution on WebDirect or using the solution on FileMaker desktop or FileMaker Go on iPad. Is there a way that if the solution knows your platform it uses different scripts
Just like on first window open trigger, it sends the user to the correct layout based on your platform.
Thanks in advance.
Take a look at the Get (ApplicationVersion) function.
In conjunction with an IF statement in your scripts you can do what you are looking for.
In addition, I'll say that many of the Starter Solutions do this. Open one (create where you can find it) and look for a script such as "Trigger | On First Window Open" (which is called when the file opens). There you will see a $$variable being set (so it will be used throughout the solution). Then there are If/Else If/Else to direct you to the correct layouts (for the platform).
It will give you some ideas, so probably worth a check of the scripting for the Starter Solutions.