How to use Applescript to create the same new file in all subfolders?

Well. A timeout problem with a different script probably warrants a separate topic. :wink: But reading through the code, I can’t see any obvious timeout bottlenecks. There are things which strike the eye:

  1. The entire code’s in a single ‘with timeout …’ statement. It’s probably best to limit such statements to areas where they may be needed, but I can’t justify this assertion off the top of my head at the moment. :wink:
  2. The script makes lots of new names, but doesn’t do anything with them.
  3. At the end, it attempts to move the files to the text “Hard Drive:Users:Macintosh:Documents:Security Videos:Security Videos” instead of to a folder specifier.

Unlike copying, simply moving items to a different folder on the same disk doesn’t involve gigabytes of data as the items themselves aren’t physically duplicated or moved. The disk directory’s simply modified to change the path to them. But I don’t know how many items the Finder can ‘move’ at once. (The Finder doesn’t do the moving itself, of course, but passes on instructions to macOS’s disk management routines.)

I think, it is problem with instruction move every file of theFiles to theFolder. Because the OP defines theFiles 2 times: firstly as Finder’s folder, then as alias. I don’t think the alias support move files command of Finder. At least, quickly.

Then, if Hard disk is some external usb disk with damaged folder structure, this command may work very-very slow. Or, stop response at all.