Newbie to scripting here.
I’d like to create a dialog window that prompts user to choose 2 files (“pos”, and “neg”). I’d also like to store these file paths as a variable to use later on. I’m having trouble storing the file paths. Instead of storing the chosen paths, I am only able to collect the default path.
import os from java.io import File from ij import IJ from ij.gui import GenericDialog from fiji.util.gui import GenericDialogPlus gdp = GenericDialogPlus("test") gdp.addFileField("pos", "C:/Users/") pos = gdp.getNextString() gdp.addFileField("neg", "C:/Users/") neg = gdp.getNextString() gdp.showDialog() print("yourfiles "+ pos+ " " + neg)
But this just returns:
yourfiles C:/Users/ C:/Users/
even if the user has selected a new file, ie: C:/Users/test.tiff
I’d like the output to be based on whatever the user chose:
yourfiles C:/Users/test.tiff C:/Users/negative.tiff
What command am I missing? Thanks!