Function getFileText 'store the current selection info cursorX = document.selection.GetActivePointX(eePosView) cursorY = document.selection.GetActivePointY(eePosView) anchorX = document.selection.GetAnchorPointX(eePosView) anchorY = document.selection.GetAnchorPointY(eePosView) document.selection.SelectAll fullText = document.selection.Text document.selection.SetAnchorPoint eePosView, anchorX, anchorY document.selection.SetActivePoint eePosView, cursorX, cursorY getFileText = fullText end Function ' prompt for search string searchStr = prompt("Search String", "") ' get selection and full file fileText = getFileText 'loop through the lines of the file, parse out those that contain the search text resultText = "" lineNum = 0 lines = Split(fileText, vbcrlf) for each line in lines lineNum = lineNum + 1 if InStr(1, line, searchStr, 1) then resultText = resultText + cstr(lineNum) + ": " + line + vbcrlf end if next ' ====== SHOULD WRITE TO OUTPUT BAR HERE - FUNCTION IS NOT AVAILABLE IN SCRIPTING LANGUAGE ======= ' ====== ALTERNATIVE IS WRITE TO NEW FILE ======= editor.NewFile() document.writeln(resultText)