Stop variable from triggering from continuous calculation

I have 21 pdfs that contain a different set of workouts each. I'm working out every day using 1 pdf. And I would like to cycle through them. So I made a macro in km that open (from a keyboard shortcut) the specified pdf based on the calculation that is set on the variable [workout].
The problem is that I don't know how to stop the other pdf from opening.. I want to open just one pdf when I trigger the macro based on the calculation .. here is a screenshot of what I've done :

OK, there is an easy way, and a hard way.

  • Easy way
    • Rename your workout PDFs to all have the same root name, and end with the day number, like:
    • image
      .
  • Hard Way

Here's an example of the easy way. If this really won't work for you, and you need help with the hard way, let me know.

You will need to change the magenta colored Action to match your full path and file naming convention.
~/Documents/Test/Workouts/Workout for Day %Variable%DND_OSF__Counter%.pdf

But do NOT change the end of the path:
%Variable%DND_OSF__Counter%.pdf

Please let us know if this works for you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MACRO:   Open Specific File Based on Counter [Example]

**Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/9/3/930dd3e06f44e858f3f47db6b8b3542b29d5994e.kmmacros">Open Specific File Based on Counter [Example].kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**




---



<img src="/uploads/default/original/3X/9/9/99099a8bf19e38b909b8347832b7bffe8a170be9.png" width="612" height="1018">
2 Likes

The easy way worked.. thank you very much. I can also change the order of the workouts and add new ones easily [ nice bonus ! ]

1 Like