Is there something I should do about this? thanks.
That error is usually seen when when trying to copy more than one file to a single target that isn't a directory. For example:
cp file1.txt file2.txt Sync/targetFile.txt.
We really need to see the script you are trying to execute -- or, better yet, the whole macro -- to know why that's happening though.
I am not aware of any macro that initiates this. It has always been visible on the screen, and I just now decided to ask. I don't have copy-macros that I am aware of.tx
If you click "OK", does the window come back at a later time?
It's displaying the result of an "Execute shell script" action -- unfortunately for us, the macro that has that action in it can have completed while leaving the dialog still up, so won't be visible in the "Cancel" section of the KM menu bar item.
You could try selecting the "All Macros" folder in the KM "Groups" pane and then typing "cp" or "Macros.plist" in the search box (top-right of the KM window) to try and find the offending macro. Even searching for "Execute shell script" may give a clue...
Thanks. I just took a look and found only these:
I don't use DropBox to sync macros (the synced file is stored on a directory that is linked to my Box account; I did see that it is accumulating versions of itself:
Not sure if that is related to the problem.
I've unchecked potentially offending scripted kbm commands, eg this (which I don't even use):
As for clicking "OK", I can't get it to appear at will; it resides in the background and shows up whenever I logout or restart.
"cp" looks innocuous:
I don't think it's negatively affecting the performance of the app or anything else, so perhaps not worth tracking down?
Perfect -- it's the first one.
cp -rp ~/Library/Application\ Support/Keyboard\ Maestro/Keyboard\ Maestro\ Macros.plist ~/Dropbox/KBM Sync/Keyboard\Maestro\ Macros.plist
cp (and most shell commands) a space character means "and this is another argument". Mac users love spaces in file and directory names so, to stop
My Directory being treated as
My and also as
Directory we get round this by "escaping the space" with a
\ or wrapping our paths in double-quotes --
My\ Directory or
If you look at the error message you'll see
cp: Sync/Keyboard\ Maestro\ Macros.plist is not a directory and, sure enough, if you look at the script there's an unescaped space just before
Sync. So what the script is actually saying is "copy my KM Macros plist and the ~/Dropbox/KBM file into the Sync/Keyboard\ Maestro\ Macros.plist file".
You can't copy two files into one file, hence the error. And if you could, it would still error because neither ~/Dropbox/KBM nor Sync/Keyboard\ Maestro\ Macros.plist exist.
r option for
cp is legacy and you should be using
All that is a long-winded way of saying "escape the space between 'KBM' and 'Sync' and you'll be OK". But hopefully it explains why and you'll be better prepared next time this happens (and we all get this wrong, all the time!).
Corrected command in full, for completeness:
cp -Rp ~/Library/Application\ Support/Keyboard\ Maestro/Keyboard\ Maestro\ Macros.plist ~/Dropbox/KBM\ Sync/Keyboard\Maestro\ Macros.plist