Export all Command Console Scripts

From C3 Wiki

Jump to: navigation, search

[edit] Summary

This script allows you to export all command console scripts from your site into the output window.

[edit] Example

Run the following from the command console window

//SEM 4-27-09: Print all Command Console Scripts
var setScripts = ApplicationEntity.getResultSet("CommandScript").elements();   
?setScripts.count() + " command console scripts were found in this store:" + "\n" + "\n"
for(var i=1; i<=setScripts.count(); i++){
   ?"//////////////////////////  COMMAND CONSOLE SCRIPT " + i + "  /////////////////////////////"   
   ?"\n"
   ?"Name: " + setScripts.item(i).name;
   ?"\n"
   ?"Language: " + setScripts.item(i).language;
   ?"\n \n"
   ?setScripts.item(i).script;
   ?"\n"
   ?"\n"
   ?"\n"

}