Got it working, but using filechooser still required.