I love PS Pad - it's customization capabilities are unsurpassed among text editors.
I have an area where I think further customization capabilities would create a whole new appeal for PS Pad. I've seen other asking for this and I've built a work around. I am hoping that Jan might see the great value there would be in this for log analysis. For Windows Installer classes I teach, I preconfigure PS Pad to analyze Windows Installer logs. I've included syntax highlighting. And search functionality to search terms only on MSDN and Technet (since a google search on a log term generates millions of irrelevant log postings on the net). I also link the MSI SDK help file to ALT-F1. (I also preconfigure it for vbscript custom actions scripting for the Scripting and Custom actions class I teach.) Students are almost giddy when they use PS Pad's "Find => List" functionality and see how it can condense their problem determination time dramatically. However, they have to memorize the many precise search terms to take advantage of it. So I have recently created a PS Pad script to allow them access to these terms directly. However, due to the lack of PSPad scripting commands, it uses VBScript "SendKeys" This works fine for setting the global option because it is a radio button. It does not work well for setting the Regex checkbox because it is a checkbox. Being able to be sure I was submitting a regex would make this functionality into pure gold.j I will be attempting to enhance the below script a lot, but I will obviously continue to be dependant on the last state of the "Find" dialog. As a side note, I think I know a way that this could be done with filter functionality or the log file (which I may use for summary reports later) - but neither of these allow "clicking a line" in the results and they are slower. Another side note: if ALT-F1 would drop me into the help file's "search" section instead of "index" it would be immensely helpful for log file analysis where a helpfile has relevant information in it. Save the following in your PS Pad\Scripts\VBScript folder and load up an MSI log - you will probably find some in your TEMP folder. Combined with syntax highlighting - this makes for pretty powerful log analysis - just gotta get my hands on regex! Thanks for your excellent software. D. '******************************************************************** '* '* Name: DesktopEngineercom.vbs '* Author: Darwin Sanoy '* Updates: '* Bug Reports & ' Enhancement Req: [email protected] '* '* Built/Tested On: Windows Vista, PS Pad 4.5.4 (2346) '* Requires: OS: Any, PSPad Editor '* '* '* Main Function: '* Runs various analysis on MSI files '* Credits: '* *) started with code from Scott Greenberg at http://gogogadgetscott.info/computers/cc/ '* '* Usage and Notes: '* '* '* Implementation Details: '* '* Assumptions & '* Limitations: '* '* License: Licensed to use for previous students of '* DesktopEngineer.com Classes '* '* Version: 1.1 '* '* Revision History: '* 3/2/08 - 1.1 - inital version (djs) '* '******************************************************************* Const module_name = "DesktopEngineer.com MSI Log Analysis" Const module_ver = "1.1" Sub FindList (Text2Find) If Verbose Then msgbox Text2Find Set SH = Wscript.CreateObject("WScript.Shell") SH.AppActivate "PSPad" Sleep(100) SH.SendKeys "^f" Sleep(100) SH.SendKeys Text2Find Sleep(100) SH.SendKeys "%e" Sleep(100) SH.SendKeys "{TAB 5}" Sleep(100) SH.SendKeys " " ' Sleep(100) ' SH.SendKeys "%O" Set SH = Nothing End Sub Sub ListYourSearchTerm FindList InputBox("Find: ", module_name, "error") End Sub Sub ListPolicies FindList " policy " End Sub Sub ListElevatedPrivilegesDetails FindList "privilege" End Sub Sub ListErrors FindList "error" End Sub Sub ListSkippedItems FindList " skipping " End Sub Sub ListUnsatisfiedConditions FindList "Condition is " End Sub Sub ListProductName FindList ": ProductName =" End Sub Sub ListActionExitCodes FindList ": action ended " End Sub Sub ListMainEngineExitCodes FindList ": mainenginethread " End Sub Sub ListFinalPropertyValues FindList "Property" End Sub Sub FindFirstFeatureComponentStates FindFirst "Feature:" End Sub Sub FindFirstStartOfDeferredScript FindFirst ": Running Script:" End Sub Sub FilesCopied FindList ": File: " End Sub Sub ListRegistryKeysCreated FindList ": Executing op: Reg" End Sub Sub ListPropertyChanges FindList "PROPERTY CHANGE" End Sub ' ------------------------------------------------------------------------------ ' Build Menu. ' ------------------------------------------------------------------------------ Sub modVersion GoGo.displayHelp "Module (" & module_name & ") version: " & moduleVersion(module_name) End Sub Sub testing msg = "" For i = 100 To 130 msg = msg & "sc" & i & ":: MsgBox %A_ThisHotkey%" & vbNewLine Next GoGo.handleSelText(msg) End Sub Sub Init menuName = "&" & module_name addMenuItem " -- Lists --" , menuName, "" addMenuItem "-" , menuName, "" addMenuItem "Your Search Term" , menuName, "ListYourSearchTerm" addMenuItem "Files Copied" , menuName, "ListFilesCopied" addMenuItem "Registry Keys Created" , menuName, "ListRegistryKeysCreated" addMenuItem "Errors" , menuName, "ListErrors" addMenuItem "Skipped Items" , menuName, "ListSkippedItems" addMenuItem "List Unsatisfied Conditions" , menuName, "ListUnsatisfiedConditions" addMenuItem "Property Changes" , menuName, "ListPropertyChanges" addMenuItem "Final Property Values" , menuName, "ListFinalPropertyValues" addMenuItem "Policies" , menuName, "ListPolicies" addMenuItem "Action Exit Codes" , menuName, "ListActionExitCodes" addMenuItem "Main Engine Exist Codes" , menuName, "ListMainEngineExitCodes" addMenuItem "Elevated Privilege Details" , menuName, "ListElevatedPrivilegesDetails" addMenuItem " -- Move To --", menuName, "" addMenuItem "-", menuName, "" addMenuItem "Feature Component States" , menuName, "FindFirstFeatureComponentStates" addMenuItem "Start Of Deferred Execution" , menuName, "FindFirstStartOfDeferredScript" addMenuItem "Script module &version", menuName, "modVersion" addMenuItem "&Open script file" , menuName, "openFile" End Sub -- <http://forum.pspad.com/read.php?2,49249,49249> PSPad freeware editor http://www.pspad.com
