I suspect $$TheOS is not yet set or contains the wrong value. Possible is also a typo in the variable name of $$TheOS.
With Advanced version of FM you can easliy check its value with script debugger and data viewer. With Pro version use a custom dialog to check the value of $$TheOS.
Good catch! Thank you.
I modified the code to the following and that worked perfectly.
Set Variable [ $$TheOS; Value:Get ( SystemPlatform ) ]
If [ $$TheOS = 1 ]
Set Variable [ $$FolderPath; Value:"/Drive-1/Users/MyName/MyData/DataOut" ]
Else If [ $$TheOS = -2 ]
Set Variable [ $$FolderPath; Value:"ﬁlewin:/c:/DataOut" ]