Issues with Max for Live and Applescript using shell external

Cphas's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Ok so I'm working on a M4L that will allow me to dynamically load clips into a live set. I'm using the shell external to copy an als file (containing the clips) to the clipboard, using the LOM to select where I want it to go and then using applescript again to simulate a 'command v' keypress. Everything works fine except that the copy command doesn't work in the context of M4L device (it works fine in max standalone). Can anyone shed any light onto why this might be and hopefully offer a solution? It doesn't seem to be the shell external as the 'command v' osascript call works fine. I've attached my code for your perusal.