Prompt User to Select Folder

How can I use a popup similar to system.file.openFile() to prompt the user to select a folder (directory) where files will be written?

system.file.saveFile?

1 Like

Unless the nuance was to allow a directory to be selected, which we don't have a convenient helper for; you'll have to do some scripting.

Something like:

2 Likes

I have an XML tree that I made with xml.etree.ElementTree. Usually I'd use tkinter and tree.write to prompt for the directory location and save the file.

How would I go about doing something similar in Ignition?

I think you need to follow Paul's advice/post, it seems system.file.saveFile will only let the user point to a file, not a directory.

1 Like

Thanks. The JFileChooser is exactly what I needed

I get a permission denied error when I try to write the file. I'm not trying to do it anywhere restricted, just user\documents

My user has permissions for the folder. How can I troubleshoot this issue?

Are you sure the path is exactly what you think it is? Any chance Windows file separators are getting mixed up somewhere, so you think you're writing to Users\Documents but you're actually attempting to implicitly create a Users/Documents folder, for instance? Are the paths fully qualified?