One use of Apple Intelligence is to have it examine your files and come up with better names for them. Here are two examples of Shortcuts that use AI to rename files, one that looks at image files, and another that looks at PDF files.
▶ You can also watch this video at YouTube.
▶ Watch more videos about related subjects: Apple Intelligence (13 videos), Shortcuts (76 videos).
▶ You can also watch this video at YouTube.
▶ Watch more videos about related subjects: Apple Intelligence (13 videos), Shortcuts (76 videos).
Video Summary
In This Tutorial (00:00)
Learn how to use Apple Intelligence and the Shortcuts app to automatically rename image and PDF files based on their content. You'll see how to create Quick Action shortcuts, build AI prompts, and test different models for the best results.
Create a New Quick Action Shortcut (00:57)
- Open Shortcuts and create a new shortcut.
- Set it as a Quick Action in the Finder to receive files as input.
- Configure it to ask for files if no input is provided.
Repeat Through the Files and Get File Details (01:30)
- Use “Repeat with Each” to process multiple files.
- Get the original file name and file extension for later use.
- Keep the extension to preserve the file type after renaming.
Build the Apple Intelligence Prompt (02:51)
- Add the “Use Model” action to call Apple Intelligence.
- Write a prompt: ask for a 2–5 word descriptive file name under 32 characters with spaces, no extension, and no extra text.
- Insert the file (repeat item) into the prompt so the model can analyze it.
Rename the File With the Results (04:36)
- Use “Rename File” with the repeat item as the target.
- Build the new name: OriginalName (AI Response).Extension
- Insert variables for name, response, and extension in sequence.
Testing With Sample Images (05:55)
- Test the shortcut on one image, then on multiple files.
- Private Cloud Compute works well; on-device may be too limited.
- Grant permissions as needed during the first run.
Customize and Refine (06:56)
- Adjust the prompt for style, word count, capitalization, or extra details.
- Consider adding safeguards for unexpected AI responses.
- Optionally remove the original name and use only the AI result.
Renaming PDF Files With Apple Intelligence (07:40)
- Similar Quick Action setup as with images.
- PDFs are harder to process directly, so first extract the text.
- Use “Get Text from PDF” to work with actual content.
Extract the First Lines Of Text From the PDF (08:36)
- Split text by new lines and count the lines.
- Use a calculation to get the first 100 or fewer lines.
- Combine the selected lines back into a single text block.
Check To Make Sure the PDF Has Text (10:14)
- Use an If statement to skip files with no extracted text.
- Prevents errors with scanned image PDFs that have no OCR.
Build the Apple Intelligence Prompt (10:45)
- Create a prompt using the first 100 lines of text as context.
- Ask for a 2–5 word descriptive file name with no extension.
- Insert the combined text into the prompt for analysis.
Complete and Test the PDF Renaming Shortcut (11:15)
- Assemble the new file name as OriginalName (Response).pdf.
- Run the quick action on sample PDFs to confirm accuracy.
- On-device works for PDFs, but Private Cloud or ChatGPT may improve results.
Try Different AI Models (12:23)
- Test On-Device, Private Cloud Compute, and ChatGPT to compare results.
- Experiment with how many lines of text improve naming accuracy.
- Adjust settings as needed for your specific PDFs or images.
Summary
Create Quick Action shortcuts that use Apple Intelligence to rename images and PDFs automatically. Extract file details, build effective AI prompts, test with different models, and customize your prompts and logic to get accurate, descriptive file names.
Video Transcript
Hi, this is Gary with MacMost.com. Let me show you how you can use Apple Intelligence to help you rename files.
So one of the things that Apple Intelligence can do is it can look at the contents of files. For instance, Image Files or PDF Files. It can figure out a better file name for that file. Using the Shortcuts app you can have Apple Intelligence examine the file and also rename it. So you can batch rename a bunch of, say, images with better names.
Here I've got a folder that has a bunch of images and the file names aren't very good. They don't really tell me what's in the file. So it would be great to be able to go into each one, take a look at it, and come up with a better name for it and then rename it. But these are a lot of files. Imagine of instead of just 7 you had 70 or 700. Apple Intelligence can do this work for you.
So I'm going to launch the Shortcuts App here and create a new shortcut. Let's go to the details here and set it up as a Quick Action and say we want to use it in the Finder. This will put here, at the top, what it receives. We can select this and I'll select all and deselect all to clear it out and say we want to select Files. If there is no input we'll have it ask for and then Files. So we can actually just run this right here from Shortcuts and have it work as well. Now we may receive more than one file. So we're going to want to repeat through all of the files that come in. So we're going to search for Repeat With Each and use this and it will automatically say Repeat With Each item in the shortcut input. Now we're going to start off by getting the details of the files that come in. I'm going to put this here and the Detail we want is going to be the name of the file. I'm going to click here and I'm going to look for the name.
We're going to use this later on because we don't want to actually replace the name completely. At least not in this example. Instead we're going to add to the name so it will keep whatever information that is in the file name already.
Now we're also going to want to add another Get Detail from the Repeat item. So notice how this puts the incorrect thing here. We'll click here, clear it out, click here again, and then choose Repeat Item. This time we're going to get the detail of the file extension because as we can see here images often have different file types. There are JPEGs, HEICs, and so on. So we want to remember the file extension so when we rename the file we keep the same file extension.
If you find these videos valuable consider joining the more than 2000 others that support MacMost at Patreon. You get exclusive content, course discounts, and more. You can read about it at macmost.com/patreon.
Now we're going to use Apple Intelligence and Search for Model here. We want to use Use Model, which means use Apple Intelligence model. I'm going to put it right here. I'm going to clear this out and I'm going to put in a prompt, an AI prompt that will have it look at the file and figure out a better file name. So here's the prompt I've got. Look at this image and create a good file name for it. It should be 32 characters or less and describe the image using 2 to 5 words. 32 characters I just wanted it to be relatively short. I don't want it to come up with a whole sentence. Then it says use spaces to separate words, not dashes or underscores. Because I experimented and found it likes to put dashes instead of spaces. Spaces are fine in file names. Do not include any file extension. Because it is a file name I'm asking for it often puts the file extension there. I don't want it to do that because I'm going to provide the file extension myself. Then just return those 2 to 5 words and no other text at all. That prevents it from saying things like here's that file name you requested. Then here is the image and then a colon. You go to a new line and then I'm going to Control Click, two finger click, or right click here. Insert variable and then I'm going to insert the Repeat Item. This tells this Action to not only include this text but also send along the image.
Now I can choose the model I want. I have 3 options here. Private Cloud Compute is Apple Intelligence. On Device means just the Apple Intelligence that's installed on the Mac. In other words don't call out to the internet. If we really need it to be better quality results we may have to switch to using ChatGPT instead of either one of these.
So now hopefully it has returned from this a file name. That's good. So now we want to Rename the file. So let's search for Rename here and we'll choose Rename File and put this underneath. We're going to rename and use the Repeat Item again here for the first thing to a new name. The new name is going to start with the original name here. So I'm going to control click in here and say Insert Variable and then get name. So it is going to get this. Then I'm going to add a space, a left parenthesis and then I'm going to Control Click again, insert variable, and say response. Then right parenthesis dot and then Control Click one more time here and insert variable. I get the file extension. So to build a file name using original name and just putting in parentheses whatever these 2 to 5 words are, and then using the original file extension.
Now, next let's give this a name and I'm going to click here and give it a better icon. Let's say use this purple here. I'll search for image or photo. There's one. Let's use this one right here. So we have a nice little icon there. We'll click on there to make sure it is selected. We have a nice shortcut here. Double check to make sure that under Details we have it setup as a Quick Action to show up in the Finder. Alright, so now we're ready to go. I've already figured out that using On Device doesn't work. I guess it is not powerful enough to figure out the name for these images.
Private Cloud Compute seems to work pretty well. So I'm going to switch to that. Then I'm going to go to this list of images here. I'm going to try with just one first. I'm going to select this one here. I'm going to Control Click, right click, or two-finger click. Go to Quick Actions and sure enough there's rename image files. I'm going to select it and it's going to run. Pretty quickly it figures out a name that's very much correct for this image. Now let's try it for all of these. I'm going to select All of them, like that. Control Click, right click, or two-finger click to get to Quick Actions and rename the image files. It should loop through them, one-by-one. I'm going to give it permission there. Sometimes it will prompt for different permissions as it hits different files. You can see it will go through each one of these and I get decent names for all of them.
Now it is important to customize this as you want. You may not want to include the original file name at all, but just the response here. You may want to give it further instructions, like to use all capital letters. Use more or fewer words or talk about the type of description, like always include a color. That kind of thing. Remember with AI it is always important to experiment especially with the prompt here. You may want to even add further safeguards in. For instance, if this doesn't return 2 to 5 words it may return the entire sentencing it couldn't figure out. You may want to have an IF statement down here saying that if it is greater than a certain number of characters then assume it failed and don't do the rename.
Now what about other types of files. It is fairly easy to do something with, say, text files but what about PDF files where it may be a little harder to actually look inside the PDF and figure out what is going on. You can try to use almost exactly the same kind of shortcut to feed it the entire PDF. But I found it doesn't work very well especially if the PDF is large. So instead I'm going to extract text from the PDF and try to use that to get a file name. After all it should be able to describe the PDF without having to see everything. Just read a bit of the text. So here's that shortcut. Like the other one it is going to be configured to be used as a Quick Action in the Finder. So it is going to receive Files from Quick Actions, and if not ask for files. It is going to repeat and it is going to get the name from each item. It doesn't need to get the extension because these will all have dot pdf extensions. Then it is going to get the text from the PDF.
So this is an action that simply gets text for a PDF here. Then I use the split text action here to split the text by new lines. Splitting it by new lines allows me to get just the first 100 lines of text. I do that by using the Count Action here. Counting items gives me the number of items or, in this case lines, of text. Then I use the Calculate Expression, right here, to calculate the minimum of either 100 or count. So if it's 150 lines this will return 100 lines. If it is only 50 lines it'll return 50. This is important because the next thing that I want to use is Get Item From List. Which will get the items in a range, which is what is want, from 1 to the calculation result. The reason I need to go to all this extra trouble here is because if I just said 1 to a 100 and there are fewer than 100 lines that are returned from the PDF, it will give an error. Then from that list of up to 100 items, combine them so use the combined text function and combine them with new lines. So, in other words I'm extracting the lines of text, converting to a list, getting the first 100 lines, and then converting it back to text.
So now I've got just the text of the first 100 lines. But I'm going to do a check here. If the combined text has any value then it's going to do everything. But if not, if there's no value there, then it won't do anything. It's not going to call the model. It's not going to rename the file. That's because some PDFs are just scans of images or just images. If there's no text in the PDF then it is not going to be able to figure out what to name the file. This whole thing will fail. So I just want it to skip it. If it is just simply a scan set of images it is not even going to try to rename it.
Then I'm using this as a prompt. This is some of the text from a PDF file. Based on this text what would a good file name for this PDF file be? Return 2 to 5 words that best describes it. It is okay to use spaces in a file name. Return only the 2 to 5 words and no other text or file extension. Here is the text. Then I inserted the combined text by control clicking insert variable and used combined text. So, it's jut going to put the text here. It's going to be one long prompt with up to 100 lines after it. In this case instead of just putting that all into the Rename function I'm going to use a text function here and create the file name. So, name space left parenthesis, the response, right parenthesis dot PDF. Then I'm going to say Rename the item with this text. That should rename PDF files based on the first 100 lines of text that are found.
Let's give it a try here. Going to select All of these. Control Click and then I'm going to Rename PDF files. Then it is going to go through these and try to come up with better names for them. I'm going to give it permission. So this calls this Treasure Island PDF. That in fact is what it is. It is the book Treasure Island. This is the tax payor identification form. This is a library service application and this is a leave request form. Job well done and notice in this case I was able to stick with the On Device model. If I switch to Private Cloud Compute it will use Apple Intelligence and I may get different results. Let's try it. I'll run the Quick Action. So it definitely gave us a different thing. Now let's try it using ChatGPT. So there we get results. If you've got a set of PDFs, you may want to try a sample of those using the different models to see which one gives better names and also you may want to experiment with the number of lines included. For instance including 150 or 200 lines may give you much better results for your particular set of PDFs.
Hopefully this gives you a good idea of one use of Apple Intelligence right now to help you with the files on your Mac. Hope you found this useful. Thanks for watching.
Download these Shortcuts: 3390ShortcutsRename.zip



I really like this page format with a scrollable pane of the video summary + timestamps and a pane with the transcripts on the same page as the video. Very nice.
Superb! Thank you.
Is it possible to do this with MP3 files mostly long lectures to name by topic or theme?
Daniel: Experiment and see. There are certainly plenty of AI transcription apps and sites out there (look for MacWhisper) if your goal is to transcribe a single mp3, and then you can feed that transcript file into AI for chapters and such. That's how the "Video Summary" you see above is done.