Action Menu

The Action menu lists commands for use with the Action panel. See the Action reference topic for more information on the Action panel itself.

Clear

Clears all settings on the Action panel. Clearing the action reduces clutter, which makes it easier to start with a completely new action definition.

Open

Loads the file selection and action definition from a PowerGREP action file that you previously saved. Both the current file selection and action will be replaced with those saved in the file. PowerGREP results files also contain file selection information. If you select a results file, only the file selection and action information will be read from the file.

You can quickly reopen a recently opened or saved action file by clicking the downward pointing arrow next to the Open button on the Action toolbar. Or, you can click the right-pointing arrow next to the Open item in the Action menu. A new menu listing the last 16 opened or saved files will appear. Select “Maintain List” to access the last 100 files.

Save

Save the current file selection into a PowerGREP file selection file. You will be prompted for the file name each time.

All settings you made in both the File Selector and the Action panel will be saved. If you want to save the action definition only, without the file selection, consider adding the action to a PowerGREP Library instead.

Action files are appropriate for actions that you execute repeatedly, in exactly the same way. Action files can be executed from the command line. You can even generate them with other applications. Use libraries to store boilerplate action definitions for later adaptation.

Favorites

If you often open the same files, you should add them to your favorites for quick access. Before you can do so, you need to save the action to a file. PowerGREP’s window caption will then indicate the name of the action file. Click the downward pointing arrow next to the Favorites button on the Action toolbar, or the right-pointing arrow next to the Favorites item in the Action menu. Then select “Add Current Action” to add the current action file to the favorites. Pick a file from the menu to open it.

If you click the Favorites button or menu item directly, a window will pop up where you can organize your action favorites. If you have many favorites, you can organize them in folders for easier reference later.

Add to Library

Adds the current action definition to the PowerGREP Library. Unlike saving an action, which saves both the action definition and file selection, only the action definition itself is added to the library. You don’t need to save the action before adding it to the library. A copy of the entire action definition is stored in the library file itself.

Only valid action definitions can be added to libraries. If something is amiss, error message will appear. Correct the error, and try adding the action to the library again.

Preview

Click the Preview button on the Action toolbar, or press F9 on the keyboard, to execute the action without creating or modifying any files. Previewing an action is always perfectly safe. It will never do anything that you might regret later.

You should make a habit of using the Preview button rather than the Execute button, even when displaying search matches or when you set the target type to “do not save results to file”. In those situations, the Preview and Execute buttons do exactly the same. Still, you should use the Preview button, just in case you made a mistake when preparing the action you are about to execute.

That said, as long as you tell PowerGREP to keep backup copies, any action, except deleting files, can be undone.

When you preview an action, PowerGREP will show detailed search results on the Results panel.

Execute

The Execute item in the Action menu executes the action for real. If the target type calls for files to be created or modified, executing the action will do so. PowerGREP will show detailed search results on the Results panel.

On the Action toolbar, the Execute button is not labeled “Execute”. Its label depends on the action type and target type you’ve chosen. The “Search” and “Count” labels are used for actions that do not modify any files. All other labels indicate that the action will create and/or modify files.

You can speed up executing an action for real after you’ve previewed it by turning on the option to search only through files with results. If you know none of the files were modified since you did the preview, turn on this option so PowerGREP doesn’t needlessly search files without matches again.

Quick Execute

The Quick Execute item in the Action menu executes the action for real, without keeping individual match results. The Results panel will only show how many matches were found in each file. Files will be created or modified according to the target type.

Just like the Execute button, the Quick Execute button on the Action toolbar changes its label depending on the action type and target type you’ve chosen. The “Quick Search” and “Count” labels are used for all actions that do not modify any files. All other labels indicate that the action will create and/or modify files.

There is no difference between Execute and Quick Execute for the “count matches” and “list files” action types, because such actions never keep individual search matches. For such actions the label of the Quick Execute button on the Action toolbar is the same as that of the Execute button.

For all other actions, Quick Execute can be significantly faster and use far less of your computer’s memory than Execute or Preview. That’s because it doesn’t have to keep track of each individual match to be able to show you all the details on the Results panel. If you don’t plan to inspect the search results, Quick Execute is the way to go.

When preparing a new action that you plan to execute on a large number of files, or some very large files, you should first preview the action on just a couple of the files. When you’re confident the action works the way it should, expand the file selection to all the files, and use Quick Execute to execute it for real.

Pause

Pauses the action or sequence that is being previewed or executed. The Results panel shows the portion of the results that have already been collected. Pausing an action can be useful if PowerGREP is running an action that is taking a long time to complete and is slowing down your computer. If you need your computer to do something else, you can pause PowerGREP, do the other thing, and then resume PowerGREP.

You cannot close PowerGREP while an action is paused. Pausing an action is instant and leaves everything in a suspended state. PowerGREP keeps its locks on files if it had any files open that it was searching through or writing results to. If you want to close PowerGREP, either resume the action and wait for it to complete, or abort the action.

You don’t need to pause an action if you merely want to pause the Results panel to get a better look of the results collected so far. To pause the results display without pausing the action itself, turn off the Automatic Update option in the Results menu. Then you can look at the results PowerGREP gathered so far while allowing it to continue to find the rest in the background.

Resume

Resumes a paused action or sequence.

Abort

Aborts the action or sequence that is being previewed or executed. The Results panel shows the portion of the results that had already been collected. Aborting the action does not automatically undo its effects. Files that had already been modified will not be reverted. Files that had already been created will not be deleted. The partially executed action will be added to the Undo History, where you can undo its effects.

If an action doesn’t seem to be doing what you intended, click the Abort button, inspect the results gathered so far, undo the action’s effects, correct the action definition, and execute it again.