﻿<?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  » Resort to default item if dynamically set item is not found (a.k.a. avoid error forced quit)</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 27 May 2026 01:06:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Resort to default item if dynamically set item is not found (a.k.a. avoid error forced quit)</title><link>https://forums.millisecond.com/Topic20507.aspx</link><description>I would like to have an image selected based on participant input--specifically I want an image named with the participants last name to be selected based on the participants input for their last name. My primary concern is that the image will be named wrong or will the participant will make a typo by accident and the intended image will not be found and will force the experiment to quit. I would like to, if possible, have my script resort to a default image in the event that the participant-specific image is not found.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Does anyone have any thoughts or insight?</description><pubDate>Wed, 22 Feb 2017 10:18:38 GMT</pubDate><dc:creator>mlleng13</dc:creator></item><item><title>RE: Resort to default item if dynamically set item is not found (a.k.a. avoid error forced quit)</title><link>https://forums.millisecond.com/Topic20847.aspx</link><description>&lt;div data-id="20511" class="if-quote-wrapper" unselectable="on" data-guid="1487786875879"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20511" 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="20511" 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="20511" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20511"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20510" class="if-quote-wrapper" unselectable="on" data-guid="1487786875879"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20510" 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="20510" 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="20510" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20510"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20509" class="if-quote-wrapper" unselectable="on" data-guid="1487786875879"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20509" 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="20509" 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="20509" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20509"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20508" class="if-quote-wrapper" unselectable="on" data-guid="1487786875879"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20508" 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="20508" 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="20508" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20508"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20507" class="if-quote-wrapper" unselectable="on" data-guid="1487786875879"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20507" 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="20507" 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="20507" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20507"&gt;&lt;div class="if-quote-message-margin"&gt;I would like to have an image selected based on participant input--specifically I want an image named with the participants last name to be selected based on the participants input for their last name. My primary concern is that the image will be named wrong or will the participant will make a typo by accident and the intended image will not be found and will force the experiment to quit. I would like to, if possible, have my script resort to a default image in the event that the participant-specific image is not found.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Does anyone have any thoughts or insight?&lt;a class="if-quote-goto quote-link" href="#" data-id="20507"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;You can achieve that like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;item myitems&amp;gt;&lt;br/&gt;/ 1 = "default.jpg"&lt;br/&gt;/ 2 = "smith.jpg"&lt;br/&gt;/ 3 = "miller.jpg"&lt;br/&gt;/ 4 = "jones.jpg"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture mypicture&amp;gt;&lt;br/&gt;/ items = myitems&lt;br/&gt;/ select = 1&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ participantimagename = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text allimagenames&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%item.myitems.item.2%&amp;gt;,&amp;lt;%item.myitems.item.3%&amp;gt;,&amp;lt;%item.myitems.item.4%&amp;gt;")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;openended myopenended&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.participantimagename = concat(tolower(openended.myopenended.response),".jpg");&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(contains(text.allimagenames.item.1, values.participantimagename)) picture.mypicture.item.1 = values.participantimagename]&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ position = (50%, 60%)&lt;br/&gt;&amp;lt;/openended&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("Last name:")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=mypicture]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1=myopenended; 2=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20508"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Dave,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thanks for the solution. Is there any way I could do this without having to update the code itself (i.e., avoid the myitems step all together).&lt;br/&gt;&lt;br/&gt;Ideally, I would like to limit the things I have to do with the images to simply making sure that the image is in the right format and in the right folder. For example, what I would do if I could guarantee that an error did not occur is something along the lines of:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/participantInput = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox Lname&amp;gt;&lt;br/&gt;/ caption = "Please enter your last name"&lt;br/&gt;/ required = true&lt;br/&gt;/ mask = alphabetic&lt;br/&gt;/ position = (30%, 25%)&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage name&amp;gt;&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ questions = [1=Fname]&lt;br/&gt;/ ontrialend = [values.participantinput = textbox.Lname.response]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture participant&amp;gt;&lt;br/&gt;/ items = "&amp;lt;%values.participantinput%&amp;gt;.jpg"&lt;br/&gt;/ position = (50%, 75%)&lt;br/&gt;/ size = (6%,10%)&lt;br/&gt;/ valign = bottom&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;Based on my own tests, this will work as long as everything is spelled correctly, the image is in the containing folder, and the image is in the right format. The reason I don't want to have to update the script itself is because I wont know the participants early enough in advance to guarantee having enough time to update the script.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Is there anyway to accomplish what I am talking about/is it clear what I am talking about?&lt;br/&gt;&lt;br/&gt;Thanks again.&lt;a class="if-quote-goto quote-link" href="#" data-id="20509"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;gt;  Is there any way I could do this without having to update the code itself?&lt;br/&gt;&lt;br/&gt;No. If you want things to be fail-safe, you need to build in the necessary checks, and that means the script *must* know which images do and do not exist. Otherwise it has no way of preventing failure. Does this make sense?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20510"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Quick idea: Prompt the participant to enter her/his last name twice and check if the two responses match; if they do not, repeat. While this will not be 100% fail-safe, it should reduce the risk of typos and potential associated failures significantly.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20511"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Dave,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Sorry for not posting this sooner, I have been pretty busy. I actually found that if you use the &amp;lt;include&amp;gt; element and simply use code similar to the following you can set a default without having to list every possible image.&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/response = kip&lt;br/&gt;&amp;lt;/values&lt;br/&gt;&amp;lt;item playerimage&amp;gt;&lt;br/&gt;/ 1 = "&amp;lt;%values.response%&amp;gt;.png"&lt;br/&gt;/ 2 = "kip.png"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 22 Feb 2017 10:18:38 GMT</pubDate><dc:creator>mlleng13</dc:creator></item><item><title>RE: Resort to default item if dynamically set item is not found (a.k.a. avoid error forced quit)</title><link>https://forums.millisecond.com/Topic20511.aspx</link><description>&lt;div data-id="20510" class="if-quote-wrapper" unselectable="on" data-guid="1485195506023"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20510" 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="20510" 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="20510" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20510"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20509" class="if-quote-wrapper" unselectable="on" data-guid="1485195506023"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20509" 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="20509" 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="20509" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20509"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20508" class="if-quote-wrapper" unselectable="on" data-guid="1485195506023"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20508" 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="20508" 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="20508" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20508"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20507" class="if-quote-wrapper" unselectable="on" data-guid="1485195506023"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20507" 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="20507" 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="20507" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20507"&gt;&lt;div class="if-quote-message-margin"&gt;I would like to have an image selected based on participant input--specifically I want an image named with the participants last name to be selected based on the participants input for their last name. My primary concern is that the image will be named wrong or will the participant will make a typo by accident and the intended image will not be found and will force the experiment to quit. I would like to, if possible, have my script resort to a default image in the event that the participant-specific image is not found.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Does anyone have any thoughts or insight?&lt;a class="if-quote-goto quote-link" href="#" data-id="20507"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;You can achieve that like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;item myitems&amp;gt;&lt;br/&gt;/ 1 = "default.jpg"&lt;br/&gt;/ 2 = "smith.jpg"&lt;br/&gt;/ 3 = "miller.jpg"&lt;br/&gt;/ 4 = "jones.jpg"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture mypicture&amp;gt;&lt;br/&gt;/ items = myitems&lt;br/&gt;/ select = 1&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ participantimagename = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text allimagenames&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%item.myitems.item.2%&amp;gt;,&amp;lt;%item.myitems.item.3%&amp;gt;,&amp;lt;%item.myitems.item.4%&amp;gt;")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;openended myopenended&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.participantimagename = concat(tolower(openended.myopenended.response),".jpg");&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(contains(text.allimagenames.item.1, values.participantimagename)) picture.mypicture.item.1 = values.participantimagename]&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ position = (50%, 60%)&lt;br/&gt;&amp;lt;/openended&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("Last name:")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=mypicture]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1=myopenended; 2=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20508"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Dave,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thanks for the solution. Is there any way I could do this without having to update the code itself (i.e., avoid the myitems step all together).&lt;br/&gt;&lt;br/&gt;Ideally, I would like to limit the things I have to do with the images to simply making sure that the image is in the right format and in the right folder. For example, what I would do if I could guarantee that an error did not occur is something along the lines of:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/participantInput = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox Lname&amp;gt;&lt;br/&gt;/ caption = "Please enter your last name"&lt;br/&gt;/ required = true&lt;br/&gt;/ mask = alphabetic&lt;br/&gt;/ position = (30%, 25%)&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage name&amp;gt;&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ questions = [1=Fname]&lt;br/&gt;/ ontrialend = [values.participantinput = textbox.Lname.response]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture participant&amp;gt;&lt;br/&gt;/ items = "&amp;lt;%values.participantinput%&amp;gt;.jpg"&lt;br/&gt;/ position = (50%, 75%)&lt;br/&gt;/ size = (6%,10%)&lt;br/&gt;/ valign = bottom&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;Based on my own tests, this will work as long as everything is spelled correctly, the image is in the containing folder, and the image is in the right format. The reason I don't want to have to update the script itself is because I wont know the participants early enough in advance to guarantee having enough time to update the script.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Is there anyway to accomplish what I am talking about/is it clear what I am talking about?&lt;br/&gt;&lt;br/&gt;Thanks again.&lt;a class="if-quote-goto quote-link" href="#" data-id="20509"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;gt;  Is there any way I could do this without having to update the code itself?&lt;br/&gt;&lt;br/&gt;No. If you want things to be fail-safe, you need to build in the necessary checks, and that means the script *must* know which images do and do not exist. Otherwise it has no way of preventing failure. Does this make sense?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20510"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Quick idea: Prompt the participant to enter her/his last name twice and check if the two responses match; if they do not, repeat. While this will not be 100% fail-safe, it should reduce the risk of typos and potential associated failures significantly.&lt;br/&gt;</description><pubDate>Mon, 23 Jan 2017 10:20:58 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Resort to default item if dynamically set item is not found (a.k.a. avoid error forced quit)</title><link>https://forums.millisecond.com/Topic20510.aspx</link><description>&lt;div data-id="20509" class="if-quote-wrapper" unselectable="on" data-guid="1485194673625"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20509" 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="20509" 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="20509" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20509"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20508" class="if-quote-wrapper" unselectable="on" data-guid="1485194673625"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20508" 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="20508" 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="20508" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20508"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20507" class="if-quote-wrapper" unselectable="on" data-guid="1485194673625"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20507" 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="20507" 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="20507" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20507"&gt;&lt;div class="if-quote-message-margin"&gt;I would like to have an image selected based on participant input--specifically I want an image named with the participants last name to be selected based on the participants input for their last name. My primary concern is that the image will be named wrong or will the participant will make a typo by accident and the intended image will not be found and will force the experiment to quit. I would like to, if possible, have my script resort to a default image in the event that the participant-specific image is not found.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Does anyone have any thoughts or insight?&lt;a class="if-quote-goto quote-link" href="#" data-id="20507"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;You can achieve that like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;item myitems&amp;gt;&lt;br/&gt;/ 1 = "default.jpg"&lt;br/&gt;/ 2 = "smith.jpg"&lt;br/&gt;/ 3 = "miller.jpg"&lt;br/&gt;/ 4 = "jones.jpg"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture mypicture&amp;gt;&lt;br/&gt;/ items = myitems&lt;br/&gt;/ select = 1&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ participantimagename = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text allimagenames&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%item.myitems.item.2%&amp;gt;,&amp;lt;%item.myitems.item.3%&amp;gt;,&amp;lt;%item.myitems.item.4%&amp;gt;")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;openended myopenended&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.participantimagename = concat(tolower(openended.myopenended.response),".jpg");&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(contains(text.allimagenames.item.1, values.participantimagename)) picture.mypicture.item.1 = values.participantimagename]&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ position = (50%, 60%)&lt;br/&gt;&amp;lt;/openended&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("Last name:")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=mypicture]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1=myopenended; 2=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20508"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Dave,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thanks for the solution. Is there any way I could do this without having to update the code itself (i.e., avoid the myitems step all together).&lt;br/&gt;&lt;br/&gt;Ideally, I would like to limit the things I have to do with the images to simply making sure that the image is in the right format and in the right folder. For example, what I would do if I could guarantee that an error did not occur is something along the lines of:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/participantInput = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox Lname&amp;gt;&lt;br/&gt;/ caption = "Please enter your last name"&lt;br/&gt;/ required = true&lt;br/&gt;/ mask = alphabetic&lt;br/&gt;/ position = (30%, 25%)&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage name&amp;gt;&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ questions = [1=Fname]&lt;br/&gt;/ ontrialend = [values.participantinput = textbox.Lname.response]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture participant&amp;gt;&lt;br/&gt;/ items = "&amp;lt;%values.participantinput%&amp;gt;.jpg"&lt;br/&gt;/ position = (50%, 75%)&lt;br/&gt;/ size = (6%,10%)&lt;br/&gt;/ valign = bottom&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;Based on my own tests, this will work as long as everything is spelled correctly, the image is in the containing folder, and the image is in the right format. The reason I don't want to have to update the script itself is because I wont know the participants early enough in advance to guarantee having enough time to update the script.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Is there anyway to accomplish what I am talking about/is it clear what I am talking about?&lt;br/&gt;&lt;br/&gt;Thanks again.&lt;a class="if-quote-goto quote-link" href="#" data-id="20509"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;gt;  Is there any way I could do this without having to update the code itself?&lt;br/&gt;&lt;br/&gt;No. If you want things to be fail-safe, you need to build in the necessary checks, and that means the script *must* know which images do and do not exist. Otherwise it has no way of preventing failure. Does this make sense?&lt;br/&gt;</description><pubDate>Mon, 23 Jan 2017 10:06:56 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Resort to default item if dynamically set item is not found (a.k.a. avoid error forced quit)</title><link>https://forums.millisecond.com/Topic20509.aspx</link><description>&lt;div data-id="20508" class="if-quote-wrapper" unselectable="on" data-guid="1485191544148"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20508" 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="20508" 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="20508" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20508"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="20507" class="if-quote-wrapper" unselectable="on" data-guid="1485191544148"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20507" 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="20507" 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="20507" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20507"&gt;&lt;div class="if-quote-message-margin"&gt;I would like to have an image selected based on participant input--specifically I want an image named with the participants last name to be selected based on the participants input for their last name. My primary concern is that the image will be named wrong or will the participant will make a typo by accident and the intended image will not be found and will force the experiment to quit. I would like to, if possible, have my script resort to a default image in the event that the participant-specific image is not found.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Does anyone have any thoughts or insight?&lt;a class="if-quote-goto quote-link" href="#" data-id="20507"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;You can achieve that like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;item myitems&amp;gt;&lt;br/&gt;/ 1 = "default.jpg"&lt;br/&gt;/ 2 = "smith.jpg"&lt;br/&gt;/ 3 = "miller.jpg"&lt;br/&gt;/ 4 = "jones.jpg"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture mypicture&amp;gt;&lt;br/&gt;/ items = myitems&lt;br/&gt;/ select = 1&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ participantimagename = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text allimagenames&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%item.myitems.item.2%&amp;gt;,&amp;lt;%item.myitems.item.3%&amp;gt;,&amp;lt;%item.myitems.item.4%&amp;gt;")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;openended myopenended&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.participantimagename = concat(tolower(openended.myopenended.response),".jpg");&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(contains(text.allimagenames.item.1, values.participantimagename)) picture.mypicture.item.1 = values.participantimagename]&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ position = (50%, 60%)&lt;br/&gt;&amp;lt;/openended&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("Last name:")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=mypicture]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1=myopenended; 2=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20508"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Dave,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thanks for the solution. Is there any way I could do this without having to update the code itself (i.e., avoid the myitems step all together).&lt;br/&gt;&lt;br/&gt;Ideally, I would like to limit the things I have to do with the images to simply making sure that the image is in the right format and in the right folder. For example, what I would do if I could guarantee that an error did not occur is something along the lines of:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/participantInput = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox Lname&amp;gt;&lt;br/&gt;/ caption = "Please enter your last name"&lt;br/&gt;/ required = true&lt;br/&gt;/ mask = alphabetic&lt;br/&gt;/ position = (30%, 25%)&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage name&amp;gt;&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ questions = [1=Fname]&lt;br/&gt;/ ontrialend = [values.participantinput = textbox.Lname.response]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture participant&amp;gt;&lt;br/&gt;/ items = "&amp;lt;%values.participantinput%&amp;gt;.jpg"&lt;br/&gt;/ position = (50%, 75%)&lt;br/&gt;/ size = (6%,10%)&lt;br/&gt;/ valign = bottom&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;Based on my own tests, this will work as long as everything is spelled correctly, the image is in the containing folder, and the image is in the right format. The reason I don't want to have to update the script itself is because I wont know the participants early enough in advance to guarantee having enough time to update the script.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Is there anyway to accomplish what I am talking about/is it clear what I am talking about?&lt;br/&gt;&lt;br/&gt;Thanks again.</description><pubDate>Mon, 23 Jan 2017 09:26:38 GMT</pubDate><dc:creator>mlleng13</dc:creator></item><item><title>RE: Resort to default item if dynamically set item is not found (a.k.a. avoid error forced quit)</title><link>https://forums.millisecond.com/Topic20508.aspx</link><description>&lt;div data-id="20507" class="if-quote-wrapper" unselectable="on" data-guid="1485189919894"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20507" 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="20507" 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="20507" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;mlleng13 - Monday, January 23, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20507"&gt;&lt;div class="if-quote-message-margin"&gt;I would like to have an image selected based on participant input--specifically I want an image named with the participants last name to be selected based on the participants input for their last name. My primary concern is that the image will be named wrong or will the participant will make a typo by accident and the intended image will not be found and will force the experiment to quit. I would like to, if possible, have my script resort to a default image in the event that the participant-specific image is not found.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Does anyone have any thoughts or insight?&lt;a class="if-quote-goto quote-link" href="#" data-id="20507"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;You can achieve that like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;item myitems&amp;gt;&lt;br/&gt;/ 1 = "default.jpg"&lt;br/&gt;/ 2 = "smith.jpg"&lt;br/&gt;/ 3 = "miller.jpg"&lt;br/&gt;/ 4 = "jones.jpg"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture mypicture&amp;gt;&lt;br/&gt;/ items = myitems&lt;br/&gt;/ select = 1&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ participantimagename = ""&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text allimagenames&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%item.myitems.item.2%&amp;gt;,&amp;lt;%item.myitems.item.3%&amp;gt;,&amp;lt;%item.myitems.item.4%&amp;gt;")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;openended myopenended&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.participantimagename = concat(tolower(openended.myopenended.response),".jpg");&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(contains(text.allimagenames.item.1, values.participantimagename)) picture.mypicture.item.1 = values.participantimagename]&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ position = (50%, 60%)&lt;br/&gt;&amp;lt;/openended&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("Last name:")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=mypicture]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1=myopenended; 2=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 23 Jan 2017 08:47:01 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>