I'm trying to make a macro to copy selected files to a selected folder (always same folder).
How can I do it?
How did you do this?
Thank you for your answer, Gregwarrior, but still I don't know how to do it.
Maestrokeyboard is no that easy for me.
Just click on the macro link here and it will be imported into your Keyboard Maestro Editor. Please don't forget to activate it.
Copy to folder.kmmacros (2,1 KB)
You only need to create a folder in the Finder where you want to copy the files. Then please select the Finder folder in the KM macro.
For a better understanding, here is a short video tutorial:
If you have any questions, please contact me.
really cool! thx @appleianer!
can one also use the to path and auto create a dated folder when i copies the file?
ie something like
where the %DATE is the current ISO date?
Hi @zeltak, I can help you with that. Before I send you a macro I wanted to ask if you use TextExpander, aText, Typinator etc. on your Mac?
I @zeltak use a macro to quickly and efficiently organize my desktop.
I create a folder with date and title from a selection of files and move it to mine. GTD folder to be able to arrange them at the end of the day.
In my example, I've now stuck with your wish to "copy the files to a folder in the Finder".
Of course you can change the date format (red arrow).
GTD Eingang : KM Date.kmmacros (3,9 KB)
However, I prefer a solution where I can use a KM popup window to select a specific date format via a TextExpander snippet.
The advantage is also that I can have the TextExpander window displayed in the middle of my desktop, which makes my input more comfortable.
At 27 inches a blessing for my eyes
Thx alot @appleianer, really appreciate you answer and help!
i have a few issues with this method.
fitst of all it dosent seem to reliably work here. also if i try and copy a file right after that there is a folder name conflict.
most important issue is that i want to to copy the folder to a different location and then create a folder there (with the date)
so the ideas scenario can be seen in this workflow example
~ in finder.
issue the macro
~/.emacs.d/ is copied to
i thought perhaps there was a placeholder for date/time one could enter in the path for the copy/move dialog? like this:
if not is it worth putting in a feature request :D?
You can do something like this:
Copy File to Dated Backup.kmmacros (6.2 KB)
There is. Use this token:
in a related question. i wonder why using a variable to be used to create a folder name wont work. i have this:
it gives me an error and wont copy it to a folder named
yet it does work in the display text and show the correct value for
The example I gave above does use variables.
You didn't provide a downloadable macro, so we can't fully see what you've done or test it.
Best guess is that either you've fouled up the path in a way you're not seeing – or there's already a file at the destination.
Keyboard Maestro will NOT overwrite files for safety sake.
You have to delete them manually before using a move/copy/create action.
OR you have to resort to the shell.
sorry @ccstone for not posting the full macro
attached is the macro as requested
i tried to used your example with the variables but cant get it to work
thx again for all your help
Copy to BK.kmmacros (3.0 KB)
Your problem becomes pretty evident when you run this version on a single selected file:
Copy the path out of Keyboard Maestro and paste into BBEdit, so you get a nice mono-space-font view of it.
If that's not clear report back, and I'll walk you through it.
Copy to BK -- ccs -- 01.kmmacros (4.7 KB)
i guess im an idiot and you will have to walk me through
the display text does seem to show the correct use of the path+date
so im not sure what im missing
I went back and looked at your original question again. Apparently I misread it and missed the auto-create part.
Keyboard Maestro cannot auto-create folders during a copy or move action.
If the folder does NOT exist you cannot copy or move to it.
Sorry for the confusion.
So – you either need to employ a New Folder Action or resort to the shell.
Personally I like to use
mkdir -p in the shell, because it creates intermediate directories at need and fails silently if the directory already exists.
(There's also an AppleScriptObjC routine for this.)
cool! i come from years in the linux world so i know and like the
mkdir -p command
can the shell command take the
and if so would you mind pasting an example?
Though of course it can check for the existence of such a folder, and create it if necessary...