if (null == f) return;
String tmp = f.getCanonicalPath();
if (f.exists()) {
if (f.isDirectory()) {
String[] names = f.list();
YesNoCancelDialog yn = new YesNoCancelDialog(IJ.getInstance(), "Open folder?", "Open all "+names.length+" images in \"" + f.getName() + "\" as a stack?");
if (yn.yesPressed()) {
IJ.run("Image Sequence...", "open=[" + tmp + "/] sort");
} else if (!yn.cancelPressed()) {
for (int k=0; k<names.length; k++) {
IJ.redirectErrorMessages();
if (!names[k].startsWith("."))
(new Opener()).open(tmp + "/" + names[k]);
}