I've hit a roadblock trying to build a macro that picks a file from a directory, copies it and pastes it to program. In my case the program is Ableton Live.
To my understanding the problem lies in Ableton Live expecting the clipboard information to come from Finder, so the file (.wav sound file) going through Keyboard Maestros "Copy a File" or "Read a File" has not worked for me.
I've also tried to approach the problem through AppleScript command: set the clipboard to POSIX file "file.wav". But that gives the same result of Ableton not recognising it as copied file.
The only workaround solution I've come up with is to activate Finder, press shift+cmd+G to launch "Go to folder...", paste the file path/name, press enter, copy, activate Ableton, paste. This works, but the problem with this method is that it's very slow since opening the Finder window and loading the files in the directory takes time.
So my question is does anyone have ideas how to get this workflow working faster? The solution is probably in how to get file copied as Finder without opening the folder and Finder window. Is there some AppleScript thing or shell command that could do this that I'm not aware of?
I've tried the Set System Clipboard to File Reference and Set System Clipboard to Variable actions but Ableton doesn't react and the paste option remains unusable. There are 1/20 times when it does work though, which is really strange and I'm unable to decipher why it works sometimes and why it doesn't.
I replaced my "Go to folder..." Finder workaround with Keyboard Maestros Reveal a File and that indeed makes it faster. So thank you for that! There is still a flashing Finder window though, so it's not an ideal solution but it'll do for me for now.
If you or anyone wants to chime in and solve why Ableton doesn't seem to react to Keyboard Maestros System Clipboard commands is very welcome to.
Here's my macro (with the working version disabled)
Ok, so the %SystemClipboard% always shows a correct filename but only sometimes it is recognized by Ableton. For example I will run the macro 20 times, 13 times the paste option is unavailable, and on the 13th time Ableton picks up the file and pastes the same file for the last 7 times even though the %SystemClipboard% is changing the file. Also, it seems very random when it picks up the .wav file and when it doesn't.
Did you try a pause? I'm coincidentally having a very similar conversation with @iamdannywyatt about pasting patches into Logic Pro.
Can you try setting a named clipboard to the path/file rather than the system clipboard and then paste from that named clipboard instead? Danny and I are starting to wonder if some DAWs might have their own internal clipboards that supersede the system one.
Ah, yes sorry I did try the pause action too. Also just tested with a named clipboard and same story as with system clipboard.
It would make sense that there is some mismatch between how a DAW is looking at a clipboard and how Keyboard Maestro is doing it.
But there is still a working link between those, and that is Finder. I wonder if there are scripting possibilities with AppleScript that could bridge a DAW and Keyboard Maestro so that the DAW clipboard is fooled into thinking it's getting files from Finder? Something to think about.
There also could be a case of some mismatch happening when processing wav or midi in clipboards. But as the macro is actually working for me 1 out of 20 times makes it less probable.
Keep an eye on this thread in case anyone sheds light:
Interestingly, Danny can paste patches into his older version of Logic, and I can't in my up-to-date one, so maybe Apple made the internal clipboard even more tightly sealed...? All speculation at the moment.
@iamdannywyatt, does it work consistently for you if you reveal the file in Finder, copy and then paste into Logic?
@Plush I don't know if this will work for you, but it's working for me using Logic.
My issue was that when I copied MIDI regions and then tried pasting a file from Finder, it would still paste the region, even though the Finder's file was at the top inside the Clipboard History window, so as @noisneil pointed out, we were/are convinced that Logic has its own internal clipboard or something and so those Finder files were not being interpreted as Logic clipboard content.
What I tried was clicking in the arrangement area, without selecting any region and hitting CMD+C and that seems to "reset" the internal clipboard to "empty", since there was nothing to be copied. When I ran the macro again, it got back to copying the Finder file.
With Logic we can set custom shortcuts and there's one to "Deselect All" so I added that to the beginning of the macro to make sure no region is selected, then the second action is to hit CMD+C and then it runs the macro as it was before. And it's working now.
Maybe try this or something similar and see if it works for you? Share the results
Hope it helps
NOTE TO OTHER LOGIC USERS:
This copy-paste method works with Logic 10.6.3 (while using Catalina), but it seems that other newer versions of Logic don't allow copying and pasting, for some reason.
I see! Yes, there is a sense of things getting stuck in the DAW clipboard for me too because once a file actually gets in there through my macro, it doesn't let anything replace it until something happens which is not clear to me what it is.
That being said, before the file gets in the Ableton clipboard the paste option remains unavailable in my menu, if executing the macro is first thing I do after starting up the program. To my reasoning, that would indicate that the clipboard is actually empty when you start the DAW, and still paste doesn't react to my KM macro.
I tried your method of copying just the blinking cursor in the arrangement window but that didn't change things for me unfortunately.
For the record I'm on Monterey and Ableton 11 Suite.
Here is the solution for anyone else in the future wanting to paste a file to Ableton Live. You have to activate Finder (uncheck "All windows" so you don't get any flashing already open Finder windows), before doing "Set System Clipboard to File Reference" action, then activate Ableton, and then do a paste.