Repeating an expansion using the Pick Loop Method

Posted by Emmanuel ® , 05/04/2023, 14:17:23 Reply   Forum

In this post I will show you how to create several glossary entries that enable you to perform an action repeatedly.

This is the so-called Pick Loop Method and it can be used for litterally any action likely to be repeated.

Here, using this method, we will create a set of 4 entries to scroll down repeatedly.

The goal is that by mimicking this example, hopefully you should be able to create other sets of entries to perform other actions repeatedly.

Step 1: Create the action snippet for the action that you will want to repeat

As a first step you open the Snippet Glossary in the Glossary Viewer and add a snippet that contains the action to be repeated.

To implement the scroll down action we use the Scroll Wheel Command.

Don't forget the no no spacing directive as we don't want the expansion to produce an unnecessary space at the end.

As you can see we have given this snippet a meaningful name and display form that indicates what action it performs.

Step 2: Create the action loop snippet

Then we create the action loop snippet:

This snippet will be referenced in the next 2 entries that we will create. What does it do?

  • {Snippet}scroll-down{/Snippet} will scroll down once and
  • {Pick}scroll-down-again{/Pick} will propose to scroll down again as a pick choice.

Step 3: Create a pick list that proposes the action again

Now we create the pick list that proposes the action again.

It has only one choice and it simply references the previously created action loop snippet.

Step 4: Create an expansion glossary to produce the action repeatedly

Finally we create the expansion glossary entry with the dedicated short form of our choice.

It also simply references the previously created action loop snippet

Practically, you will start a scroll down loop by expanding this entry:

Upon expanding dd the document will be scrolled down once and the expansion table will display a pick choice that enables you to scroll down again:

At that point, if you want to continue scrolling further down, you will do so by hitting your marker key (or space bar for those who expand with the space bar) in a loop, until you have scrolled down enough.

The expansion table will always propose to scroll again. So you may wonder, how do I stop this loop? Simply by ignoring the displayed pick choice when you are done, and continue typing whatever you want to. The fact that the expansion table displays a pick choice does not mean that you mandatorily need to pick something. :-)




Edit | Reply | | | |   | Current page | Author