So that it works
g_rootDoc = app.activeDocument;
must be outside the function (unless you pass the source document to this function).
Modified Code:
if (documents.length != 0) { g_rootDoc = app.activeDocument; // g_progBar = new ProgressBar(); // no worky in cs2 ProcessLayersWithoutXML(g_rootDoc); alert("Done!"); } else { alert("Missing active document"); } function ProcessDocumentWithoutXML() { } ProcessDocumentWithoutXML(); function ProcessLayersWithoutXML() { }
source share