Timesavers: CFEclipse Scribble Pad

Monday, April 27, 2009

This is part of an ongoing series on Timesavers. The goal is simple: short, easily-digestible posts designed to help developers get faster and more productive

One of my favorite CFEclipse features is the "Scribble Pad". Its primary purpose is exactly what its name suggests: to jam out some quick, throwaway code. I use it all the time when I come across a new function I want to test, or I want to see how a chunk of code will behave in isolation before I drop it into real production code.

The scribble pad is simply a .cfm file that you keep in a project somewhere. I'm a big fan of having at least one "Sandbox" project in my workspace, so that's where I keep my scribble pad file. Here's how I set up scribble pad:

  1. Ctrl-N and create new CFML project named "Sandbox"
  2. Store project at c:\inetpub\wwwroot\sandbox
  3. Ctrl-N to create new file named "scribble.cfm" in that project
  4. Hit the scribble icon in the toolbar (it's the one that looks like a pencil).
  5. The first time you do this, it should prompt you for the location of your scribble file. Point to your scribble.cfm, and give it the appropriate URL. In my case, it's http://localhost/sandbox/scribble.cfm

Then, when you have some code you want to try out, hit F8 or click the scribble icon. This will load your scribble file. It will also load the CFEclipse Browser View and run the scribble.cfm page. As you modify your code, hit F5 to refresh the Browser view and see your changes. You do not need to give the browser focus in order for F5 to refresh it; you can keep your cursor in the code.

Here’s what it looks like:


Then, as you monkey with the code, you simply hit refresh in the Browser view to see the changes.

Note: if you hit the scribble icon and nothing happens, you may need to set up the scribble in your preferences.

Window -- Preferences -- filter on Scribble

It'll pop up a box that looks like this:


Then, enter in the appropriate information. In my case, I entered "scribble.cfm" as the file, "sandbox" as the project, and http://localhost/sandbox/scribble.cfm as the URL. If you don't enter in the URL, then the browser view will NOT load with the scribble URL; rather, it'll load empty, and this isn't what you want.

For me, scribble is a huge timesaver because it gives me a quick place to test stuff without having to a) run the code inside my app or b) create new files for running it in isolation.

Bottom line: Scribble pad rocks. F8 loads it.


Lola said...

The second image is for QuickDiff . . . is this what you meant to use?

Marc Esher said...

Lola, huh? what? whatchu talkin about? ;-)

GoWestWeb said...

Marc -thank YOU my friend! perfect example of tools we wish we had... and do... and didn't know... until now! This will save so many clicks and refreshes just to test out functions, snippets and other little scribbly stuff - perfect!

Marc Esher said...

GWW: Awesome. Glad it helped!