Why do I get this error:
For Each.kmactions (1.0 KB)
I'm not sure what the rest of your macro is doing, or how you ended up using the %TriggerValue% token, but if I understand your goal correctly you should instead be using %File%
(the name you chose for the "For each" portion).
The fact that the file in your error has a leading dot is curious, and I wonder if that's the true path of the file.
If changing to %File%
doesn't work for you, please post the full macro so we can investigate.
To expound on what @avtraino said, the for each
action is assigning the variable file
to each file in the ~/Desktop
location, and the nested move file
action is attempting to act on the file assigned to that variable (obviously not all at the same time, but one at a time in alphabetical order). But you have used the %TriggerValue%
token in the first field, which may or may not be the file you are attempting to move. So replace %TriggerValue%
with %Variable%File%
and it should start working for you. Let us know if it doesn’t.
@avtraino I was using %TriggerValue% based on recommendation from @jmichaeltx and @peternlewis here: Move Downloads Folder Content to Desktop Macro - #2 by kcwhat
@cdthomer changing the variable to %Variable%File% still does not work
You need to show us the whole macro - not just a few actions from it. Can you post that up here please?
Move ALL files from Desktop to Downloads.kmmacros (2.4 KB)
Here is the whole macro - it monitors for files added to Desktop and moves them to Download folder - similar to the macro in the reference I provided above.
OK - so this is what'll work for you:
Download Macro(s): Move ALL files from Desktop to Downloads.kmmacros (2.1 KB)
The semaphore ensures files added to the Desktop are processed and moved one at a time - if you're adding more than one file at a time that is. Works fine for single files too.
Take a look at this post from @jmichaeltx in the thread you linked.
You're using the Folder trigger, which provides the path of the triggering file as %TriggerValue%
, then you're redundantly looping through every file in the source folder. Instead, you should act on the %TriggerValue% directly, without a loop.
Edit: @tiffle beat me by a hair
The solution was alluded to in that thread but never posted. Try this:
Move ALL files from Desktop to Downloads.kmmacros (1.7 KB)
Hey Vito - mine's different to yours so no need to get crossed out
Thank you for your help!
@avtraino - your macro works well, no issues
@tiffle - your macro gives this error prior to moving each file:
The macro I provided doesn't have and checkpoint actions in so I suggest you are running some other macro.
I did run the macro with checkpoints disabled.
Deleting them completely fixed the problem and the macro is now working.
In which case you didn’t run the macro I posted in this thread!
@tiffle - you macro works well - I made a mistake and didn't trigger it correctly.