Creating 'add file' prompt

Hi there,

I’d like to create a prompt that I can use to add files to proces with a macro.
The basic idea is to have a prompt with an ‘add file’ button.
Clicking the button will open a dialog window in which you can choose a file that will be added to a list of paths (like a variable array maybe?) of files to proces with the macro, then repeat until you’ve added all the files you want to add.

I’ve tried using the ‘Prompt for file’ action, so far without luck.
I’m kinda new to this, so maybe there is a simple way to do this that i overlooked?
Any ideas how to get this idea to work, or if it’s even possible with KM?

Thanks! Jasper

Here is an example macro to get you started.
It is NOT a finished product. You will need to adapt it to fit your needs.
Please let us know if this answers your question.

Setup of the Prompt for File Action

###MACRO:   Prompt for File @KM8 @Test @Example

~~~ VER: 1.0    2017-09-24 ~~~

Prompt for File @KM8 @Test @Example.kmmacros (11 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.

###Use Case

  • Build a List of the POSIX Path of User Chosen Files



NOTICE: This macro/script is just an Example

  • It is provided only for educational purposes, and may not be suitable for any specific purpose.
  • It has had very limited testing.
  • You need to test further before using in a production environment.
  • It does not have extensive error checking/handling.
  • It may not be complete. It is provided as an example to show you one approach to solving a problem.


  • 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. :wink:
  • Assign a Trigger to this maro.
  • Move this macro to a Macro Group that is only Active when you need this Macro.
  • ENABLE this Macro.
    • ALL Actions that are shown in the magenta color
    • All KM Variables in this Macro have the prefix of "TEST__"
    • You should change this prefix to fit your macro.


  • While I have given this limited testing, and to the best of my knowledge it 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.


Thanks! This should help a lot!

If one of the above posts solves your problem/question as originally stated, please check the “Solved” checkbox (click for details) at the bottom of that post.

Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.

Thanks again, this did the trick for me!