ESTK Docs

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: Tom, Kukurykus

Paul MR

ESTK Docs

Post by Paul MR »

Sometimes it's handy to have documentation accessible from within ESTK.
This script adds a new Menu in ExtendScript Toolkit with a list of all chm, pdf and txt files in the specified folder.
Once a selection is made that document is opened.

Code: Select all//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Place script in relevant folder....
//C:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit CS3\Required
//C:\Program Files\Adobe\Adobe Utilities\ExtendScript Toolkit CS4\Required
//C:\Program Files\Adobe\Adobe Utilities - CS5\ExtendScript Toolkit CS5\Required
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
try {
ESTKdocs ={};
ESTKdocs.menus = {};
var menuItems=[];
//Folder where all your documents/helpfiles are:-
var docFolder = Folder('/c/programData/adobe/help');
var fileList = docFolder.getFiles(/\.(chm|pdf|txt)$/i);
   ESTKdocs.menus.extras = new MenuElement( "menu", "Docs", "at the end of menubar", "ESTKdocs" );
 for(var a in fileList){
menuItems[a] = new MenuElement( "command", decodeURI(fileList[a].name.replace(/\.[^\.]+$/, '')), "at the end of ESTKdocs", "ESTKdocs/"+a );
menuItems[a].onSelect = function() {
var count = Number(this.id.match(/\d+$/));
  File(fileList[count]).execute();
    }
}
}catch(e){alert(e +" - "+e.line);}