// +-----------------------
// | (c)2006 dvb@omino.com, subservient astronaut blog
// | 
// | file: apse_01_hello.jsx
// | astro_photoshop_scripting_examples: hello
// |
// | Obligatory and traditional...

    alert("Hello, Photoshop scripter.");

	// |
	// | Drop into debugger IF running from
	// | /Applications/Utilities/Adobe Utilities/ExtendScript Toolkit.app
	// | which is a nice little editor/debugger 
	// | for Adobe JavaScript, usable
	// | with Photoshop, After Effects, &c.
	// |

    debugger;

    // |
    // | "Hello" was fun, but now lets
    // | display an alert with a list 
    // | of current documents.
    // |
    // | "app" is the magic global application object.
    // | Many things can be directly read from it
    // | like the current open document list.
    // | other things can even be directly written to it.
    // |
    // | "documents" is a JavaScript array.
    // |
    
    var documentCount = app.documents.length;

    var i;
    var text = "Documents (" + documentCount + "):\n";
    for(i = 0; i < documentCount; i++)
       text += i + ". \"" + app.documents[i].name + "\"\n";;

    // |
    // | Display the list of document names. The alert box
    // | will grow to fit. I don't know what it does if it's
    // | huger than your screen.
    // |

    alert(text);

// | the end
