﻿<?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 5  » Batch and Variable Scope</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 24 May 2026 23:51:24 GMT</lastBuildDate><ttl>20</ttl><item><title>Batch and Variable Scope</title><link>https://forums.millisecond.com/Topic19261.aspx</link><description>Hi all,&lt;br/&gt;&lt;br/&gt;We have a couple different studies in the works in which we are trying to implement Inquisit. I am tasked with recreating our old tasks in your framework. Based on the benefits of modularization with batches, and the fact that many of our studies use identical tasks, but not identical collections of those tasks, I thought I would try to create study-specific batch scripts separate from the tasks. Ideally, I would like to create a directory on our computer with a repository of those tasks, and just point the batch script to the task files as needed. Finally I would like to place the data in a study-specific location, as opposed to a communal dumping ground.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I had hoped that by defining a value in the batch (output_prefix), that variable file would be available within the scope of the individual file elements, but it looks like it is not the case. Do you have any suggestions on how to get the desired behavior, while maintaining as much modularity as possible (and reducing redundancy)?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;Andy</description><pubDate>Thu, 16 Jun 2016 12:40:01 GMT</pubDate><dc:creator>AndrewJSchoen</dc:creator></item><item><title>RE: Batch and Variable Scope</title><link>https://forums.millisecond.com/Topic19264.aspx</link><description>It is correct that &amp;lt;values&amp;gt; defined in a &amp;lt;batch&amp;gt; script are not accessible by / within the scope of any individual scripts run by the &amp;lt;batch&amp;gt;. Moreover, script properties like the data file location are typically read-only (i.e., they cannot be set at runtime and or determined by variables).&lt;br/&gt;&lt;br/&gt;I do not see a way to satisfy your requirements using only &amp;lt;batch&amp;gt; functionality. However, you do not necessarily need to rely on &amp;lt;batch&amp;gt; elements to achieve the desired degree of flexibility and modularity.&lt;br/&gt;&lt;br/&gt;Inquisit can also be invoked via the command line (cf. &lt;a href="https://www.millisecond.com/support/docs/v5/html/howto/howtocommandline.htm"&gt;https://www.millisecond.com/support/docs/v5/html/howto/howtocommandline.htm&lt;/a&gt; and &lt;a href="https://www.millisecond.com/support/docs/v5/html/articles/batchscripts.htm"&gt;https://www.millisecond.com/support/docs/v5/html/articles/batchscripts.htm&lt;/a&gt; ) and that can be automated via shell scripts or other means to a high degree. The general workflow would then be to have a per-study shell script that:&lt;br/&gt;&lt;br/&gt;- Checks for the existence of a study-specific directory (and if none exists, creates it),&lt;br/&gt;- Copies the actual task scripts from the common directory to the study-specific directory, and&lt;br/&gt;- Executes the tasks from there in the desired order / fashion.&lt;br/&gt;&lt;br/&gt;Hope this helps.&lt;br/&gt;</description><pubDate>Thu, 16 Jun 2016 12:40:01 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>