Duplicating Files and Folders With Shortcuts

Screenshot of the main window in the Shortcuts appScreenshot of the main window in the Shortcuts app

Last week, I wrote about Python scripts for duplicating files and folders.

Those scripts work well. However, not everyone is comfortable working with Python, and they might not want to learn how to use it just for the purpose of being able to copy files and folders quickly.

For those in the Apple ecosystem, Shortcuts provides a way to accomplish the same duplication tasks.

Assuming you have a file containing the new file names, the steps to duplicate a file are fairly straightforward:

  1. Select the file to be copied.
  2. Set a variable, originalName, to the name of the file.1
  3. Select the file that contains the list of new file names (one name per line, with no carriage return after the final name).
  4. Split the file from Step 3 by new lines so that it can be used in Step 6.
  5. Select the folder where the duplicated files will be saved.
  6. Then, for each new file name:
    1. Save the original file to the folder selected in Step 5.
    2. Rename that file following the pattern newfilename + _originalName.2

That’s it. The shortcut is available here for those who’d like to use or adapt it: Duplicate File. It will work on Mac, iOS, and iPadOS devices.

Duplicating a folder works almost identically. That shortcut is available here: Duplicate Folder. The only differences between this shortcut and Duplicate File are:

  1. It’s a folder that gets selected for duplication, instead of a file.
  2. Because for my own use cases I’m unlikely to want to include the original folder name in my copies, there isn’t an originalName variable.

The Duplicate Folder shortcut will copy a folder’s entire structure, so if it contains subfolders, those will also be copied. Only the top-level folder will be renamed.

Like Duplicate File, the Duplicate Folder shortcut works on Mac, iOS, and iPadOS.

  1. If you don’t want to keep the original file name as part of the new name, you can remove this step from the shortcut. If I’m copying something like a marking sheet, the original file name will contain the name of the assignment, and I want to keep it as part of the new file name so that I know which assignment the marking sheet is for.↩︎

  2. If you don’t want to keep the original file name as part of the new file name, newfilename will do.↩︎

Up next Python Scripts for Duplicating Files and Folders Data Design and Shortcuts
Latest posts A Shortcut for Creating Random Groups Data Design and Shortcuts Duplicating Files and Folders With Shortcuts Python Scripts for Duplicating Files and Folders A Shortcut for Randomly Calling on Students The Bento Method With Things and Obisidian Importing a WordPress Xml File WordPress Export Some Thoughts on Austin Kleon’s Show Your Work! Adding Google Fonts to a Ghost Theme A Course Planning Template An Unexpected Use for a Raspberry Pi One Year Ago… Sabbatical Diary: Thinking About Grades Paperless Handwritten Feedback Filenames and LaTeX and Pandoc, Oh My! Collecting Student Work With Google Forms