How to rename and move a file using Shortcuts

I have an Automator Quick Action that used to do this but it doesn't run in Sequoia, and Shortcuts can't convert it. Yes, I've tried Apple's user guide but perhaps a Dummies approach would work better for me.

Anyway I want grab a file, containing a specific text string, from my Downloads folder, rename the file and add the date at the end of the name, preferably also add a tag, and move the file to a specific folder.

Any help would be much appreciated.

MacBook Air 13″, macOS 15.2

Posted on Dec 11, 2024 2:13 PM

Reply

Similar questions

14 replies

Dec 11, 2024 5:14 PM in response to duncantho

Here is a shortcut (for the Shortcuts application) you could use as a basis : Move & Rename File.


Customize these 3 actions as you like:



  1. Here I use a " - " as a separator between the original filename and the date. You can remove it or choose something else.
  2. The tag is "Red". Click "Red" to choose any other color.
  3. The file is moved to folder named "TestFolder". Click "TestFolder" to choose any other destination folder.

Dec 11, 2024 7:33 PM in response to 6x6

Thanks for your help, 6x6.

I dragged Rename File to the script window. Then I realized it insists on the full original file name rather than a text string from the file name. I want just the first part of the file name. At any rate in the action's second part I add my choice of changed name followed by "Formatted Date" (which, as an aside, makes me curious as to what kind of date format it will use).

And that's as far as I could get. I got an error message at the top of the action, " Please pass a name to the Rename File action." I'm not able to drag in further actions.

I'm seriously out of my depth on what I'm pretty sure is simple stuff!

Dec 11, 2024 8:11 PM in response to 6x6

Okay, I'm working on it but am still a bit stumped. In the action "Get Name from Shortcut Input" am I meant to make changes? Name and Shortcut Input have pop-ups but I'm clueless what to do with them.

Between Get Name… and Current Date there's no vertical black line. Which makes me think I am indeed meant to modify the Get Name… action.

There's also no vertical line between the Format Date action and Rename, which makes me think I'm meant to rename Shortcut Input. Out of my depth here.

Dec 12, 2024 4:26 AM in response to duncantho

Do not concern yourself with the lines between actions: they show only when the output of one action goes into the next action.


The shortcut will show in the Quick Actions pop-up menu in Finder. Just right-click your file to be renamed and moved.


To start testing, you only need to edit last action of the shortcut. This is the action that has a hard-coded destination folder. If the destination folder can change (I assumed you always wanted to move the file to the same folder), I could modify the shortcut to,prompt for a destination folder. Just let me know.

Dec 12, 2024 10:03 AM in response to 6x6

6x6, thanks again.

I'm about to drive you crazy. Sorry.

I want to start over in baby steps. I just want to move a file from one folder (Downloads) to another, with no addition of a date or change of name. The only complexity is that the file to be moved has a name that >begins with< or >contains< an unchanging text string.

I presume the first action as with your script will be Get Name, which has two pop-ups. The first I understand. I think I select 'Name". I sort of understand 'From Shortcut input'. I presume, from your example, I'd choose 'File Path.' (But 'Folder' would seem better if available!)

Then I'm lost. I've yet to put in the actual name or been able to tell Shortcuts to search for only part of the name.

The final Action seems straightforward. Move File. I presume that by this stage Shortcuts knows which file I mean. And even I can figure out the 'to' pop-up.

I hope I can avoid a privacy dialog in the resulting shortcut ("Allow … ?"). That's a bit of a killer.

As an aside, I'm curious how to post a Shortcut to this site. I imagine it involves Copy iCloud Link. AI Google says clicking that produces a dialog box - but not in my case.

Dec 12, 2024 10:22 AM in response to duncantho

Hello duncantho,


Do you mean the file has always the same name when you download it? Or do you mean the file name has a pattern that one could recognize to move it automatically? Don’t hesitate to provide a coulé of examples.


It does involve “Copy iCloud Link” to publish a link to a shortcut. This is what I used above. In Shortcuts, right-click your shortcut, choose Share > Copy iCloud Link and you should see a pop-up window like this one:



Click Share and the iCloud link will be in the clipboard. You can then paste it.

Dec 12, 2024 11:01 AM in response to 6x6

Hi again 6x6

The file name always has a consistent string. For the purposes of this script it always begins with the same first few characters but the rest of the file name varies.

Thanks for the explanation about iCloud sync. I've now tried right-clicking (and option clicking) on both the Share button and on Copy iCloud Link. No dialog box.

Dec 12, 2024 11:48 AM in response to 6x6

That's a great screenshot, 6x6 — and something I can't reproduce!

The only manual thing I want to do is to trigger the Shortcut. It should be able to grab the file by name (contains) from Downloads and move it to another (specified) folder.

Easy in Automator (or it was until Sequoia broke my Automator Quick Action — possibly the privacy requirement?). Tell Automator to Find Finder Items, name begins with, in Downloads and then to Move Finder Items to wherever.

Shortcuts has a Move (To) action but I see no Move From, and Move's assorted pop-ups befuddle me!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to rename and move a file using Shortcuts

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.