// This is a recorded macro. First, check over the // commands to make sure this is what you intended. Then, // save this buffer, and the macro should appear in the // Macros menu. int position = textArea.getCaretPosition(); Selection[] selection = textArea.getSelection(); String s = null; if (selection == null || selection.length == 0) { s = Macros.input(view, "Enter text to search for:"); if (s == null) return; } else { s = textArea.getSelectedText(selection[0]); } sidekick.SideKickActions.selectAsset(view); SearchAndReplace.setSearchString("\\b" + s + "\\b"); SearchAndReplace.setAutoWrapAround(false); SearchAndReplace.setReverseSearch(false); SearchAndReplace.setIgnoreCase(false); SearchAndReplace.setRegexp(true); SearchAndReplace.hyperSearch(view,true); textArea.setCaretPosition(position); textArea.setSelection(selection);