Path as a Variable that +1's

Hello!

Is there a way to make a variable that would be equal to a path like..
/Users/Desktop/01/0001

Then when I Run my Macro it adds +1 to the path each time it completes a repeating loop...

So like...

/Users/Desktop/01/0002
/Users/Desktop/01/0003
/Users/Desktop/01/0004
/Users/Desktop/01/0005

and so on.

Thank you!

This is just an example to help get you started. You will need to use as an example and/or change to meet your workflow automation needs.

Please let us know if this meets your needs.

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

MACRO:   Increment Number at End of String [Example]

~~~ VER: 1.0    2020-01-25 ~~~
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:

Increment Number at End of String [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


ReleaseNotes

Macro Author: @JMichaelTX

This is just an example written in response to the below KM Forum Topic. You will need to use as an example and/or change to meet your workflow automation needs.

MACRO SETUP

  • Carefully review the Release Notes and the Macro Actions
    • Make sure you understand what the Macro will do.
    • You are responsible for running the Macro, not me.

USE AT YOUR OWN RISK

  • While I have given this a modest amount of testing, and to the best of my knowledge will do no harm, I cannot guarantee it.
  • If you have any doubts or questions:
    • Ask first
    • Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Topic Title: Path as a Variable that +1's

URL: Path as a Variable that +1's

Date: 2020-01-25
Posted By: beansalad

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

This is amazing thank you! I will test it out today and get back to you.

@JMichaelTX This works great! One question I do have is how do I get it to reset back to 0001? I noticed even if I enable and disable it the path picks up from where it left off instead of resetting to 0001.

Thank you!

At least two ways to reset the Global Variable DND__Seq_Path:

  1. Delete the Variable in the KM Preferences > Variables pane
  2. Write another macro, or add an option to the existing macro to delete or clear the Global Variable.
    • Use a different trigger, or a long-press keystroke, to trigger the same macro.
1 Like