Just to make sure if the sketchPath is still recognized in recent Processing versions when we run the exported sketch using a customized main(), I’ve coded this simple test sketch below: ![]()
/**
* PApplet.main() (v1.0)
* GoToLoop (2018/Aug/12)
*
* Discourse.Processing.org/t/
* using-custom-main-string-args-breaks-file-reading-functions-
* in-windows-e-g-loadshader-loadimage/2572/10
*/
public static void main(final String[] args) {
final String sketch = Thread.currentThread().getStackTrace()[1].getClassName();
main(sketch, args);
}
@Override public void settings() {
size(800, 60);
noLoop();
println(sketchPath());
printArray(args);
}
@Override public void draw() {
clear();
text(sketchPath(), 20, 20);
if (args != null) text(join(args, " : "), 20, 40);
}
BtW, I’m using most recent 64-bit PDE v3.4 on Win 8.1 to export the sketch above. ![]()
I went to the exported’s subfolder “application.windows64/” and double-clicked the “.exe” file there. ![]()
And the sketchPath shown there matches the full path where I’m running it! ![]()
I can even open a command prompt and run the “.exe” passing typed args to it, and they’re also displayed! ![]()