Trouble with system.vision.openFiles

Hi everybody, I’m very new to Ignition but I’m loving it so far! I have, however, ran into a weird problem. I’ve got a button I want to use to open up a specific folder to list the files that the folder contains. I’ve been testing with the system.vision.openFile function, this seems to work well but does not open a folder, it opens a specific file (as it should). I wanted to use the system.vision.openFiles function but I can’t get it to work at all, according to the Vision User Manual it should work the same as the system.vision.openFile function but I keep getting hit with an argument error: caused by IllegalArgumentException: extension is not a valid keyword for openFiles. Does anybody know why this is?

Thanks in advance!

Can we see the function call with the arguments you are supplying?

1 Like

Don't use keyword arguments except where support is explicit.

Hi Greyship, thank you for responding. The function and arguments:

paths = system.vision.openFiles("xlsx")

This returns Traceback (most recent call last):
File "event:actionPerformed", line 5, in
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: extension is not a valid keyword for openFiles

caused by IllegalArgumentException: extension is not a valid keyword for openFiles

And when I use the function without arguments it returns Traceback (most recent call last):
File "event:actionPerformed", line 5, in
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: extension is not a valid keyword for openFiles

caused by IllegalArgumentException: extension is not a valid keyword for openFiles

Thanks for your help.

Hi pturmel,

Maybe I misunderstood (English is not my first language) but in the User Manual for both functions it would seem like I can use the same arguments. Is this maybe a mistake in the User Manual or am I simply not understanding the text?

openFile: system.vision.openFile | Ignition User Manual
openFiles: system.vision.openFiles | Ignition User Manual

Thanks in advance.

This looks like a bug, the keyword is “extensions” in the function prototype, but the back-end is trying to validate the keyword as “extension” and failing.

Both of these calls fail:

system.vision.openFiles("xlsx")
system.vision.openFiles(extensions="xlsx")

Gentlemen, thank you for your time and help.

I decided to use a depricated function:

paths = system.file.openFiles("xlsx")

This function is old but does work.

Thank you both.

Should this be reported to Inductive Automation?

I would open a support ticket, yes.

IIRC, a number of documented system.vision.* functions for v8.3 aren't actually ready.