Millisecond Forums

'preconditions' and 'include' in an online script?

https://forums.millisecond.com/Topic19489.aspx

By plush - 8/8/2016

Dear friends, can you use 'preconditions' and 'include' in an online script?

Would something like the code below be possible for the web-based version?

Thanks.
-------------------------------
<include>
/ precondition=[computer.platform == "windows"]
/ file="wmv_videos.iqx"
</include>

<include>
/ precondition=[computer.platform == "mac"]
/ file="mov_videos.iqx"
</include>

By Dave - 8/8/2016

Yes, conditional <include> elements work on the web just like they work in Inquisit Lab. You can use them just fine in your online experiments.
By plush - 8/9/2016

That's good to know. Do you have any advice on how to approach the example-issue for the web-based experiment, with the .mov and .wmv files?
-----------------------
<include>
/ precondition=[computer.platform == "windows"]
/ file="wmv_videos.iqx"
</include>
<include>
/ precondition=[computer.platform == "mac"]
/ file="mov_videos.iqx"
</include>

-----------------------

Would you upload a batch-script as a primary script and then upload the .wmv and .mov scripts as additional files?

Thx!

By Dave - 8/9/2016

No, <batch> serves a different purpose than <include>. You do not need any <batch> elements to administer different video formats depending on the device's platform. See https://www.millisecond.com/forums/FindPost9931.aspx for a simple example. This works on the web as well. You need to register the "main" script as your active web script. In the next step, you need to upload the two to-be-included scripts as well as the videos in both formats.