Why doesn't this code work?

ActionMenu["select an option", {"choose a file" :> 

Is there a way to get FileNameSetter to work inside ActionMenu?


1 Answer 1


two things to consider: FileNameSetter is used to generate a button which then subsequently gets pressed to open a window. When a window opens for you to select a file it is best to use the queued evaluation channel rather than preemptive.

Try this instead:

ActionMenu["select an option", {"choose a file" :> 
   (x=SystemDialogInput["FileOpen"])}, Method -> "Queued"]
  • $\begingroup$ Thank you for showing me a cleaner way to accomplish what I was after. Much obliged. $\endgroup$
    – Todd Allen
    Dec 21, 2015 at 20:03

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.