Revisiting Copy File to Directory

Background: I posted this question:

"Whenever a new subfolderB is created in FolderA I want a template fileC in FolderA to be copied into subfolderB and renamed with name of subfolderB."

Forgot to mention that all folders reside on webdav mounted volume. (I cannot run the solution offered from the mounted volume as running on Snow Leopard). So have to create a KM macro that runs on users local Mac so doesn't matter who creates a new folder, template file will get copied into newly created folder.

Suggested macro - but 1st step is showing as empty.
Screen Shot 2022-12-15 at 12.10.19

My understanding is:

  • Variable "Local__FileToCopy" gets value of the file to be copied.
  • Variable "Local__FileType" gets value %TriggerValue% which is the directory address.
  • Then if the variable "Local__FileType" is a directory
  • Copy file to be copied to directory.

I think I have wrapped my head round that.

But Variables are showing as empty. Am I missing something obvious? Is it due to directory & file being on mounted volume?

Any feedback appreciated. (Been away fro a few days.)

No -- the first step is showing "this previously empty variable is being set to /Volumes/blah/blah...". The second can't show what it will be set to because %TriggerValue% is unknown until something is created in your watched folder and the macro runs.

Otherwise -- looks good. Run it and see!

Hey Michael,

Beware of looking at the Keyboard Maestro Editor and assuming what you're seeing relative to "empty" variables other completed values are correct.

There are a number of factors that can affect these displays.

A few of them:

  • Local / Instance Variables.
  • View > Evaluate Condition Results.
  • Actions that haven't been run to populate variables.
  • Etcetera.

It's very hard to know for certain when the feedback you're getting from the Keyboard Maestro Editor is entirely correct (unless your memory is way better than mine) – so it's a good idea to always test things and to never assume.

Even after 20 years I get bit by this occasionally.