This question was inspired by yode's question found here. I think yode asked the wrong question, so I am asking what I think is the right one.

Consider a situation in which the user has to choose two directories before a computation can move forward. We want to present the user with two file-name setters but have the code wait until the user has chosen one directory from each setter before proceeding. How can we do that?

  • $\begingroup$ If you have time, could you please check this for grammar and clarity? $\endgroup$
    – Szabolcs
    Commented Apr 5, 2017 at 11:35
  • $\begingroup$ @Szabolcs. I didn't find anything wrong with the grammar, but I have made what I hope is a clarification. Do you think it clear now? $\endgroup$
    – m_goldberg
    Commented Apr 7, 2017 at 1:39

1 Answer 1



My answer is to use Dynamic with the option UpdateInterval -> 1 to hold the code that checks the completion condition.

DynamicModule[{from, to},
   {Dynamic @
        {FileNameSetter[Dynamic[from], "Directory", Appearance -> "From where"],
         FileNameSetter[Dynamic[to], "Directory", Appearance -> "To where"],
         Button["Reset", Clear[from, to]]}],
      If[And @@ {ValueQ[from], ValueQ[to]}, 
        StringJoin[{from, "  ", to}], "Waiting ..."],
      UpdateInterval -> 1]}]]

Before the condition is fulfilled, the user sees


After the condition is fulfilled, the user sees


The Reset button lets the code be reused to pick another pair of directories.

  • $\begingroup$ Thanks.Good workaround,I think the Column save me. :) $\endgroup$
    – yode
    Commented Dec 23, 2016 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.