bug with 'selectOutput'? (OSX)
in
Programming Questions
•
2 years ago
Hi - I am running into an issue where calling 'selectInput' freezes up my project. I can call selectInput from a mouse event and it works but not from a function subsequent to calling 'selectInput. This is on OSX and have tested it in the IDE as well as in an exported application.
The functionality is for a simple text file converter: user selects a text file, do some processing and then prompt the user to save the file under a new name. I stripped out everything in the test sketch below to try to isolate the issue.
Anyone seen this before and is there a workaround?
thanks!
The functionality is for a simple text file converter: user selects a text file, do some processing and then prompt the user to save the file under a new name. I stripped out everything in the test sketch below to try to isolate the issue.
Anyone seen this before and is there a workaround?
thanks!
void setup() {
size(200, 200);
}
void draw() {
}
void test(String loadPath) {
String output[] = new String[25];
for(int i = 0; i < 25; i++) {
output[i] = str(random(25));
}
println("open");
String savePath = selectOutput("Save:");
if (savePath != null) {
println(savePath);
saveStrings(savePath, output);
}
println("done");
}
void mousePressed() {
String loadPath = selectInput(); // Opens file chooser
if (loadPath == null) {
println("No file was selected...");
}
else {
test(loadPath);
}
}
1