We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionGeneral Discussion,  Status › default sketch when opening "new"
Page Index Toggle Pages: 1
default sketch when opening "new"? (Read 1311 times)
default sketch when opening "new"?
Sep 8th, 2009, 2:17am
 
Is it possible to set a default sketch to open when choosing "new" from the file menu?

I have some color arrays that i keep copying and pasting from sketch to sketch, so having a sketch that included these would be easier.

Or is there a smarter way to do this? I'm kind of new to everything processing...
Re: default sketch when opening "new"?
Reply #1 - Sep 8th, 2009, 3:49am
 
In Windows, you can define a default file content depending on format. When you define such and choose New -> Processing sketch, it will create a new .pde file following a template you gave.
But this solution isn't optimal, as you have also to create a folder of same name in the sketchbook.
I can still explain how to do the above if you wish.

Another solution is to use a clipboard manager. The one I use, CLCL (for Windows), is excellent and allows to define pre-defined content to paste.

Or just make a template sketch and Ctrl+drag'n'drop it in the sketchbook to copy it: you just have to rename folder and file and you are good to go.
Re: default sketch when opening "new"?
Reply #2 - Sep 8th, 2009, 6:41am
 
Thanks for ideas!

the solution I'm using now is having a sketch called "default" that I open and save as something else (or forget to save as something else so the default one get's all messed up...)
Re: default sketch when opening "new"?
Reply #3 - Sep 8th, 2009, 7:07am
 
Yes, that's why I prefer the Ctrl+drag'n'drop solution as I start with the copy process. Renaming is a bit boring there, but the process reduces the risk of error...
Actually, I made an AutoHotkey script which copy the file selected in Windows Explorer to a name I give. It can also copy a whole folder (but renames only the folder, not its contents, although I suppose I can do that too). I just select the original, hit F12, type the new name, and wham! a new file is born...
Re: default sketch when opening "new"?
Reply #4 - Sep 8th, 2009, 7:12am
 
Come to think of it (reminded by the Bézier Editor thread), we can make a PDE Tool to do that... It might create a new sketch from a chosen template, for example, or manage snippets.

Another idea: put your common code into a simple library. This way, not only you won't need to copy/paste your code, but you can update all your sketches at once if you want...
Re: default sketch when opening "new"?
Reply #5 - Sep 8th, 2009, 9:16am
 
yeah, I looked into maybe creating my own minilibrary, but it looked a little intimidating... I'll try
Page Index Toggle Pages: 1