Date (picker) in User Prompt while creating new folders

Hi,

I have an automation (see screenshot), which creates new folders by asking for a folder name (= place of the concert) and which adds the current date to the folder name.
Is there a smooth way, how Keyboard Maestro could ask also for a date (cause often it's not the date of today)? Maybe a date picker?

I'm pretty new to Keyboard Maestro, so apologies if I miss something obvious.

Thanks

Claus

Add another field to your prompt and use the dropdown at the right to set it to "Date" -- IIRC, if you don't set a default then it will always default to "today".

This may not be very helpful, but I have a Custom Floating HTML Prompt I cobbled together a while back with a jQuery datepicker. It works well, but it took some fiddling in an area I know nothing about and may be outdated. Here is what it looks like in case it sparks an idea or maybe causes someone who knows what they are doing to comment :stuck_out_tongue_winking_eye::

The script in the prompt looks like this:

  <script>
  $(function() {
    $( "#datepicker" ).datepicker({
      dateFormat: "mm-dd-yy",
      showOtherMonths: true,
      selectOtherMonths: true,
	numberOfMonths: [12,2],
      onSelect: function(dateText, inst) {
        var selectedDate = $(this).val();
        window.KeyboardMaestro.SetVariable( 'Instance__selectedDate', selectedDate );
        window.KeyboardMaestro.Submit('OK');
      }
});
  });
  </script>

The selected date is returned to the variable Instance__selectedDate

3 Likes

I tried doing that a while back and gave up so kudos to you @evanfuchs . Nice one and thanks for posting! :clap:

2 Likes

Thank you all for your help!

I'm stuck at the folder name stage now.
I cannot figure out how the the red field should look like now with the local__date variable. I tried all the the things I could come up with.
What I want is, that instead of the ICUDateTime (=today) it uses the User prompt

Try this:

Date (picker) in User Prompt while creating new folders.kmmacros (4.3 KB)

1 Like