Plugin samples

Calling Actions

This plugin will simply call "New PHP" action and pre-fill with custom content. Note that full list of actions can be obtained by Actions.List.

function NewPHP(Sender) {
    Actions.Execute("ActFileNewPHP");
    Editor.SelectAll;
    Editor.SelText = "<?php\n/**\n * Description of ${name}\n *\n * @author ${user}\n */\n\nclass ${name} {\n    //Class properties\n\n    function __construct() {\n        //Constructor\n    }\n\n}";
    var Sel = Editor.Selection;
    Sel.SelLength = 0;
    Editor.Selection = Sel;
}

Script.RegisterDocumentAction("", "New PHP", "", &NewPHP);