Skip to main content
m1jackson
Inspiring
November 29, 2022
Answered

Automation Blocks - Copy Folder AND Contents

  • November 29, 2022
  • 1 reply
  • 1448 views

Having read thru the documentation, I understand that the "Copy File or Folder" block only copies the contents of files, but I'm unable to figure a way to copy a folder and the interior files easily.

Copying the .mov is no problem, but the folder...?

 

Also, is there a way to "Move" the folder as an alternative, instead of copying?

This topic has been closed for replies.
Correct answer Mathias Moehl

Not sure if I understand the question correctly. The Folder block just creates a text (or in programming terms a string).

I created a function for you, which you can use to copy an entire folder:


Just noticed that the block can even be more simplified with the "get name of file path" block (which actually also works with folders and not only files)

1 reply

Mathias Moehl
Community Expert
Community Expert
November 30, 2022

The copy file or folder block can copy entire folders including their content.

See class 3 of this course:

https://mamoworld.com/docs/automation-blocks/tutorials-ae/writeCustomProjectSetupScript#class-3-copying-files-and-working-with-if-blocks

 

If you copy a folder, note that the contents of the folder is copied, not the folder itself.

That means that in this example, if you have a file ~/Desktop/src/myFile.txt, it will be copied to ~/Desktop/target/myFile.txt and not to ~/Desktop/target/src/myFile.txt.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
m1jackson
m1jacksonAuthor
Inspiring
December 1, 2022

But that is exactly what I'm trying to do. I have a folder of exrs that I need to copy (preferrable move in this case). In the video you referenced, you use a "Folder" block to copy the folder and it's contents, but that block doesn't allow for a variable.

Do I have to make a new folder in the destination then copy the files into that new folder?

Mathias Moehl
Community Expert
Community Expert
December 1, 2022

Not sure if I understand the question correctly. The Folder block just creates a text (or in programming terms a string).

I created a function for you, which you can use to copy an entire folder:

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects