Ben Meinhart

Q: "attach action to" Not Working

I am using an apple script to copy files from a ram disk to a connected server. I can make the disk and connect the server automatically but I am having trouble to get the files to copy to the server automatically.

 

I am using a main app the creates the disk and connects to the server. I also have a folder actions script that will move folders/files placed in the ram disk and move them onto the server. However, I have to manually add the FA script via Folder Actions Setup in order for the ram disk to move files to the server because, obviously ram disks and all of their data will be erased upon a restart. So I need a way to set the folder action of a new folder on a new disk.

 

I have tried to use the following command at the end of the main app but it either doesn't work or it errors out.

tell application "System Events" to attach action to folder "Filemaker" of disk "ramdisk" using "/Library/Scripts/Folder Action Scripts/FMBackups.scpt"

 

Everything was made using the Script Editor app and I do not intend to use Automator unless it would be significantly easier.

Xserve, OS X El Capitan (10.11.6), Applescript

Posted on Aug 9, 2016 2:19 PM