Organizing Long Snippet Contents

Hi @Brad_Hedinger,

Rather than "fix" the snippet, I think it would be best to share some ideas with you on how to optimize your snippets in general.

So, here are my thoughts:

  1. If a snippet is becoming huge, you probably should break it up into multiple snippets with their respective shortcuts. For instance, when I'm publishing videos in Youtube, I need to fill in the description and the tags. If I were to do it with a single snippet, I'd have to use a bunch of tab keys to travel between the fields. Instead, I just made two snippets. Remember, Text Blaze should be serving you, not the other way around.
  2. Use the repeat command when using multiple repetitions of the same thing command. You can read about it here.
  3. Tying in with point number 1, rather than having all of the data in the same snippet, you could create multiple "partial" snippets that you would then insert into the main snippet. Any variables you use in those imported snippets would also work in the main snippet.
  4. Use trim to make your snippets easier to read.
  5. Practice economizing with your {if} commands.

Below, you can see part of your snippet with some of the above concepts applied. In particular, pay attention to how I used a nested {if} command to make the {key: downarrow} only show up if there's a "Yes" included.

{formmenu: name=data;
18 Day - VA Yes;
18 Day - VA No;
14 Day - VA Yes;
14 Day - VA No;
10 Day - VA Yes;
10 Day - VA No}

{if: contains(data, "18 Day - VA"); trim=right}
{key: 1}{key: 8}{if: contains(data, "Yes")}{key: downarrow}{endif}{key: enter}{endif: trim=right}
{if: contains(data, "14 Day - VA"); trim=right}
{key: 1}{key: 4}{if: contains(data, "Yes")}{key: downarrow}{endif}{key: enter}{endif: trim=right}
{if: contains(data, "10 Day - VA"); trim=right}
{key: 1}{key: 0}{if: contains(data, "Yes")}{key: downarrow}{endif}{key: enter}{endif: trim=right}

There's a lot to unpack here, and remember, Text Blaze can be as advanced and powerful as you want it to be. Delving into the more advanced features takes some acclimatization. But that's why we're here :slight_smile:

2 Likes