New sketch when opening

Is there a way to have a new sketch made when opening the IDE

currently, I don't believe so..

sorry.. ~q

1 Like

Hi @linkdecool. The Arduino IDE developers are tracking the request for such a feature here:

If you have a GitHub account, you can subscribe to that thread to get notifications of any new developments related to this subject:

screenshot of Subscribe button


At this time, I think the closest you could reasonably get is to pass the path of a specific sketch as an argument to the Arduino IDE invocation. When you do that Arduino IDE will open that sketch instead of its default behavior of restoring the saved sketches that were open at the time you exited the previous IDE session.

As for unreasonable approaches, you could create a system that automatically clears the data from the files where Arduino IDE stores the paths of the sketches to restore on open. There is a detailed technical explanation of the system here:

https://forum.arduino.cc/t/incorrect-default-sketch-opened-when-starting-ide/1127463/10

I was able to accomplish it by opening the files in a text editor, manually removing the data from recentworkspace.json#/recentRoots[] and config.json#/workspaces[], then setting the read-only file attribute on those files to stop Arduino IDE from later being able to write new data. From some quick tests, it appears that crude approach does work, but Arduino IDE produces some error messages that might be annoying or alarming.