﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » Aborting batch element based on computer.platform</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 05 Apr 2026 23:32:20 GMT</lastBuildDate><ttl>20</ttl><item><title>Aborting batch element based on computer.platform</title><link>https://forums.millisecond.com/Topic38749.aspx</link><description>I am trying to run an experiment that should only be done on computer devices, so I’m trying to include something in my script to prevent participants with mobile or tablet devices from entering the study. Since I am running a series of scripts, I currently have a batch element that lists the various files used in the experiment. I tried to add “/ onscriptbegin = [if (computer.platform == "ios" || computer.platform == "and") script.abort(); ]”, but I am somehow still able to access the experiment from iOS and Android devices. &lt;br/&gt;What can I add so that Inquisit will filter through participants’ computer devices like so: &lt;br/&gt;- If computer.decive is “mac” or “win”, access study&lt;br/&gt;- If compiter.device is “and” or “ios”, exit study. &lt;br/&gt;&lt;br/&gt;This is the entire batch element I am running: &lt;br/&gt;&amp;lt;batch all&amp;gt;&lt;br/&gt;/ groups = (1 of 1)&lt;br/&gt;/ groupassignment = random&lt;br/&gt;/ file = "consent_task_questionnaires.iqx"&lt;br/&gt;/ file = "modified_trust_instructions.iqx"&lt;br/&gt;/ file = "treasure_hunt_game.iqx"&lt;br/&gt;/ file = "feedback.iqx"&lt;br/&gt;/ onscriptbegin = [if (computer.platform == "ios") script.abort(); if (computer.platform == "and") script.abort(); ]&lt;br/&gt;/ onscriptend = [&lt;br/&gt;&amp;nbsp; if (batch.all.currentscript == "modified_trust_instructions.iqx") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;  parameters.playerAvatar = values.avatar; &lt;br/&gt;&amp;nbsp; } else if (batch.all.currentscript == "treasure_hunt_game.iqx") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parameters.avatarNeutral = values.avatarNeutral;&lt;br/&gt;&amp;nbsp;&amp;nbsp;  parameters.avatarLow = values.avatarLow;&lt;br/&gt;&amp;nbsp;&amp;nbsp;  parameters.avatarHigh = values.avatarHigh;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;Thank you!&lt;br/&gt;</description><pubDate>Tue, 01 Apr 2025 17:49:03 GMT</pubDate><dc:creator>laurataglioni</dc:creator></item><item><title>RE: Aborting batch element based on computer.platform</title><link>https://forums.millisecond.com/Topic38750.aspx</link><description>&lt;blockquote data-id="38749" class="if-quote-wrapper" unselectable="on" data-guid="1743528785561" contenteditable="false" id="if_insertedNode_1743528784874"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="38749" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="38749" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="38749" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;laurataglioni - 4/1/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-38749"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I am trying to run an experiment that should only be done on computer devices, so I’m trying to include something in my script to prevent participants with mobile or tablet devices from entering the study. Since I am running a series of scripts, I currently have a batch element that lists the various files used in the experiment. I tried to add “/ onscriptbegin = [if (computer.platform == "ios" || computer.platform == "and") script.abort(); ]”, but I am somehow still able to access the experiment from iOS and Android devices. &lt;br/&gt;What can I add so that Inquisit will filter through participants’ computer devices like so: &lt;br/&gt;- If computer.decive is “mac” or “win”, access study&lt;br/&gt;- If compiter.device is “and” or “ios”, exit study. &lt;br/&gt;&lt;br/&gt;This is the entire batch element I am running: &lt;br/&gt;&amp;lt;batch all&amp;gt;&lt;br/&gt;/ groups = (1 of 1)&lt;br/&gt;/ groupassignment = random&lt;br/&gt;/ file = "consent_task_questionnaires.iqx"&lt;br/&gt;/ file = "modified_trust_instructions.iqx"&lt;br/&gt;/ file = "treasure_hunt_game.iqx"&lt;br/&gt;/ file = "feedback.iqx"&lt;br/&gt;/ onscriptbegin = [if (computer.platform == "ios") script.abort(); if (computer.platform == "and") script.abort(); ]&lt;br/&gt;/ onscriptend = [&lt;br/&gt;&amp;nbsp; if (batch.all.currentscript == "modified_trust_instructions.iqx") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;  parameters.playerAvatar = values.avatar; &lt;br/&gt;&amp;nbsp; } else if (batch.all.currentscript == "treasure_hunt_game.iqx") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parameters.avatarNeutral = values.avatarNeutral;&lt;br/&gt;&amp;nbsp;&amp;nbsp;  parameters.avatarLow = values.avatarLow;&lt;br/&gt;&amp;nbsp;&amp;nbsp;  parameters.avatarHigh = values.avatarHigh;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;Thank you!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="38749"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Create a script that checks the relevant properties and calls the script.abort() function if applicable. Run that script as the first in your batch.&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;block platformCheck&amp;gt;&lt;br/&gt;/ onblockBegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (computer.platform == "ios" || computer.platform == "and") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return script.abort(true);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;br/&gt;&amp;lt;/block&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;with &lt;br/&gt;&lt;br/&gt;[code]&amp;lt;batch all&amp;gt;&lt;br/&gt;/ groups = (1 of 1)&lt;br/&gt;/ groupassignment = random&lt;br/&gt;/ file = "platformcheck.iqx"&lt;br/&gt;/ file = "consent_task_questionnaires.iqx"&lt;br/&gt;/ file = "modified_trust_instructions.iqx"&lt;br/&gt;/ file = "treasure_hunt_game.iqx"&lt;br/&gt;/ file = "feedback.iqx"&lt;br/&gt;/ onscriptend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (batch.all.currentscript == "modified_trust_instructions.iqx") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parameters.playerAvatar = values.avatar;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else if (batch.all.currentscript == "treasure_hunt_game.iqx") {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parameters.avatarNeutral = values.avatarNeutral;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parameters.avatarLow = values.avatarLow;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parameters.avatarHigh = values.avatarHigh;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;br/&gt;&amp;lt;/batch&amp;gt;[/code]</description><pubDate>Tue, 01 Apr 2025 17:49:03 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>