Creating Custom Select Text Actions

Extract Text Commands In a previous article, we introduced one of the new features found in PDF Annotator – Select Text Actions. To review, when you select a word, phrase or passage in the PDF document a menu box appears, giving you several options for annotating or using that extracted text.

We included some of the more common tasks, such as copying, text markup and some search options. You can even automatically copy the selected text into a Notepad document.

However, you can also create your own custom text extraction commands. That way you are able to use the web search engines of your choice or integrate custom programs the way you need it.

Note that this only pertains to those commands in the bottom third of the extracted text actions pop up menu.

Modifying the Extract Text Options

You find this option in the customizable settings for PDF Annotator. To get there click on Extras in the menu bar and then scroll down and click on Settings.

Extract Text Options

Choose Extract Text in the TOOLS section of the settings box. This will show you the available options for the extract text actions. Notice the three column headings: Caption, Command and Parameters. The caption is the text that will show in the extracted text tools menu. The command is where the action is defined. The parameters contain any additional information necessary.

First, you can rearrange the order of the commands. Click on a command and then use the arrow buttons to move the command up or down in the list. You can move the commands you use more frequently to the top of the list.

If you have a command that you will not use, you can delete it from the list by clicking on the red minus button.

Creating a New Search Engine Action

Create a new Extract Text Command PDF Annotator includes the ability to create a new Extract Text Action. For example, you can add another search engine function for your favorite search engine. Click on the green plus sign to start a new command definition.

You may need to experiment to get the command and parameters correct. Some search engines require different command language. For example, here are two commands you may want to use:

  • Bing – Enter this in the command box:
  • DuckDuckGo uses this command:

Create a new Extract Text Command for DuckDuckGo Paste those examples into the command text box and you should be able to use them easily.

For other search engines or websites, you can proceed as follows to find out the right command: If you go to your favorite search engine, search for just one word. Then copy the text in the address bar, including the word you used, and paste that into the command box. Substitute %TEXT% for the search word. That will work in most cases.

For example, I searched for the word "dog". This is what I copied from the address bar in the browser and pasted into the command box:

I then replaced "dog" by %TEXT% after the equal sign and saved the command.

Creating a New Program Call Action

You can also create software program actions similar to the Notepad action. Here again, you may need to experiment because of differences in the setup of various programs and operating systems.

Create a new Extract Text Command for MS Word First, try entering the executable file name into the command box. For example, if you want to put the extracted text into Microsoft Word® then type winword.exe into the command box. Set the parameter to %TEXTFILE% and choose OK.

If you don't get the desired results, you may need to enter the entire path to the executable, using the Notepad action as an example.

Note that PDF Annotator gives the Word® document a default file name with the .TXT format. Choose "Save as" to save to a .DOC or .DOCX format. When using this command in Word®, you might be asked to select a coding format. Choose your option (I use the default) and click OK to resume the extraction.

For a list of variables you can use, click the Placeholders... link.

Again, you can arrange the actions to place the most frequently used at the top of the list. I hope you enjoy this new feature and find it useful when working with PDFs.