How To Use AI In Mac Shortcuts

You can feed information into an AI model in Mac Shortcuts and then perform tasks based on the results. This can be used to build your own complex and versatile productivity tools.
▶ You can also watch this video at YouTube.
▶ Watch more videos about related subjects: Apple Intelligence (11 videos), Shortcuts (74 videos).

Video Summary

In This Tutorial

Learn how to use AI and large language models inside the Shortcuts app on your Mac to automate tasks such as reformatting spreadsheet data, looking up songs, summarizing web pages, and sorting images into folders.

Reformatting Data In a Spreadsheet

  • Create a shortcut that takes copied spreadsheet data from Numbers and cleans it into plain text.
  • Feed the list into the “Use Model” action with a prompt to standardize names (for example, First M. Last).
  • Choose between on-device, Apple Intelligence, or ChatGPT models for processing.
  • Copy the AI output back to the clipboard to paste into Numbers.
  • Adjust the prompt to change formats or split columns using commas.

Tell Me About the Song Playing

  • Use a shortcut to get the currently playing song from the Music app.
  • Send the song title and artist to ChatGPT with a prompt to gather facts from Wikipedia and other sources.
  • Display the results in Quick Look or enable Follow Up to ask more questions.
  • Run the shortcut quickly via Spotlight for easy access while listening.

Custom Ways To Summarize Web Pages

  • Create a shortcut to grab the current Safari page and feed it to ChatGPT.
  • Ask for the headline question and return a direct answer without reading the whole article.
  • Test all three model options; ChatGPT often gives the most accurate results.
  • Launch via Spotlight or assign a keyboard shortcut for fast use.

Sort Image Files Into Folders

  • Select a folder containing images and category folders (like Animals, Trees, Buildings).
  • Filter folder contents to separate image files from subfolders.
  • Loop through each image and send it to the AI model to decide the correct folder.
  • Use a shell script with the mv command to move the file into the chosen folder.
  • ChatGPT handles visual categorization most reliably, and the shortcut can be adapted for PDFs or other files.

Summary

By combining Shortcuts with AI models, you can automate formatting data, learning about music, summarizing articles, and sorting files. Experiment with prompts and model choices to create powerful, time-saving workflows on your Mac.

Video Transcript

Hi, this is Gary with MacMost.com. Let me show you how you can use AI in your Mac Shortcuts. 
Now in macOS Tahoe the Shortcuts App has an Action where you can speed some text to a model, in other words an AI Large Language Model, and get a result. So how can you use this. Well, since you can just feed about any prompt you want into the AI and then get the result and do anything you want with it in the Shortcuts App, the possibilities are pretty much limitless. But practically, of course, there are some things that are easier to do in Shortcuts than other things and the results from AI Large Language Models aren't always going to be exactly what you want. So here's some practical examples just to give you some ideas of what you can do now and maybe you'll be able to take some of these ideas and modify them for your own needs. 
Now if you haven't used Shortcuts much a lot of this is probably going to be a bit too advanced for you right now. But it will give you an idea of what is possible. So the first one I want to show to you is something to do in a spreadsheet. I've got this shortcut here, called Format Spreadsheet Names, and the idea is that sometimes you get a list of names in a spreadsheet and they in all sorts of different formats. I've actually got such a list here in this Numbers document. You can see that the names are in tons of different formats. Maybe people entered them in this way or you got them from a database, like this. But you want them to be all pretty uniform. So the idea here is to be able to select a list of names and copy. Then here in the Shortcuts it will take the Clipboard result, break it up by new lines, and then combine it again with new lines. I do that because what you get when you're copying data from Numbers is basically a little mini-table and I just want to make sure we have some nice clean text for the AI to work with. For a lot of cases you may not need any of that. Then I'm going to feed in to the Special Action called Use Model that we've got starting with macOS Tahoe where you could feed a prompt into either Apple Intelligence, here called the Private Cloud Model. The On Device model of Apple Intelligence, in other words don't use the internet at all. Just use the Large Language Model that comes with the Operating System. 
So, it is appropriate for some things but not for others. Then you can use an extension, in this case ChatGBT is what Apple has enabled so far as an extension. So you could use all the power of probably the most mature model out there, ChatGPT's model. I've got that here and I'm using the prompt, This List of Names uses Different formats for each name. Change it so that each name is in the Format and then I put first and then in parentheses middle initial with a period) last. Here is the list colon and then the next line the results from this, the combined text. 
So it should get the List in here in the prompt of all those names. Now, of course, all this language can be changed. The great thing about using Large Language Models is you're just speaking to it and asking for something. So, you can try different things. If you're not getting the results you want you can try other things. You can keep modifying this. Then it is going to combine the response with New Lines. Here I've set the response to output to list. In the use model action you can say just whatever the automatic response is. Always give me text, give me a number, that kind of thing. In this case a list in Shortcuts. I want to combine that list with New Lines. Just give me some plain text and then copy that to the Clipboard.
So as you can see this can be run anywhere. As long as I copied the text from Numbers there I can now run this. I can run it from the Spotlight Menu. I can run it from here. I can add this to the Dock. However I want to run this shortcut. So I'm just going to run it right here. It's going to go through and process things. Notice I have it set to use the On Device Model. I decided for something like this, just figuring out what the names are it probably doesn't need the Online Model. Sure enough, the results here, you can see at the bottom, if produces exactly what I want. So now I can go back here to Numbers and I can Paste the results in here or I could have pasted over this to get what I wanted. It helps to paste it next to it first just of course just to do maybe an eyeball double check here just to see that it got everything the way you want it. Of course you can go back to this and change this prompt. Have it come out with a different format. Maybe have it do Last Name, First and then when you pasted it in the comma would tell Numbers you want that to be in separate columns. That could be really useful. 
You can use this for a variety of different things. Maybe there are a bunch of dates in different formats and you're going to use this to say hey I want the date to be in this very specific format. If the On Device Model doesn't give you the results you want even after playing with the prompt, you can always switch to Apple Intelligence or ChatGPT to see if it does better. 
If you find these videos valuable consider joining the more than 3000 others that support MacMost through Patreon. You get exclusive content, course discounts, and more. You can read about it at macmost.com/patreon. 
The next one I want to show you is this very simple one. Tell Me About This Song. A lot of times we're listening to music and we like to know what's the deal with this song. So this is going to get the current song from the Music App. As you can see here in Control Center I've got a song playing. Then it is going to call out to, in this case, ChatGPT. I really want some deep knowledge here so I figure the best model for this is probably ChatGPT. It's going to ask, Is the song, and here what I've done is I've inserted this result here, the song twice. But when you click on it you can have it just be the media itself or you can choose what you want. So, in this case the first time I chose title and the second time I chose artist. Then look up the song on Wikipedia and other sources. I want to kind of emphasize checkout Wikipedia when you do this. Give me some interesting facts about it. I just left it up to ChatGPT to do that. Then I'm just going to simply use Show in QuickLook to show me the results. Nothing special. I don't need any special interface here. I'm just going to run this here with that song now playing in the background. It is going to ask for permission and it is going to call out to ChatGPT and let's see what it comes back with. 
There we go. So we get a nice little bit of information about the song. It would be nice to actually call this using Spotlight and just be able to bring it up anytime I want. So I can go to the details here and I could make sure Show In Spotlight is selected. Then when I do Command Space and then Command 3 I can search for Tell Me and I can see Tell Me About This Song. So I can just maybe call this Song. Now I can just type Song and it is going to always go right to that and give me the results of this shortcut. Note that one of the things I could do instead of QuickLook I can take that away, just have it end with this. Turn On Followup. So it will give me the results but then also a prompt that allows me then to maybe ask further questions about the song. 
Imagine, for instance, how you can select text or something in a document and copy that and then use this to ask ChatGPT about it and then continue with the follow-up there to ask more questions. 
Here's another use. You know when you go to a news article or you just see a news article and it's got a question as the headline and you just want to know the answer to the question. You don't need to read a whole article about it. Well, you can have ChatGPT read the article for you and just give you the straight forward answer. So I created this, Just Answer The Question shortcut. All it does is look for the current webpage from Safari, whatever you've got running there, and then it feeds that into ChatGPT; From this article can you find a question in the headline and give me the answer to that question? If I run it now it's going to look at what is the article there in Safari. It will ask me permission the first time. I'll always allow. Then here we go. It identifies the question and it gives me the answer. Here's another one. I'll use Spotlight this time and I'll search for Just. I'll go with Command 3 to the Actions here and there's Just Answer This Question. I can add some quick keys if I want. I'll just double click on this. It's going to run the shortcut and look at the current page, this one and come up with the answer. This is a good example of a case where you need to try all the three options here. On Device and Apple Intelligence didn't actually work most of the time when I tried it. It didn't seem to be able to figure out what the headline was or figure out what the answer to the question was. The results were not great. ChatGPT, a much more mature Large Language Model, seemed to be able to figure it out almost every time. 
Now here's the last and most complex one. One of the cool things that LLMs can do is to look at images and figure out things about the images. So, what this rather longer Shortcut here is it is going to ask for a folder and then it is going to do a few things before it gets to the AI part. One is it's going to get the folder path. So it is going to use that later. Then it is going to get the content of the folder. Then it is going to filter it looking for items in here that are less than 4K. What files are less than 4K? Folders are. That is just a kind of quick way to actually filter out and only get the folders inside the folder. Why? Well, I've got this folder here and in it are a whole bunch of images. But also I've created a few folders. Animals, Building, Other, and Trees. The idea is that I want all of these images to be sorted into these folders. 
So this is going to get a list of folders. It is going to combine them with a comma and a space a set a variable called Folders to it. So it is going to get a list of those four folders. Then it is going to filter again that same list from here, from the folder that was selected and get everything greater than 4K. What's greater than 4K? Well, all the images in there. Then it is going to go and repeat through each image and send to the On Device Model because it just needs to look at the image and figure out what is there. So it is just going to use that and it's going to take each item, as it goes through a repeat loop. So each image. Look at this image and decide which of these folders it belongs in. Then I'm putting in that comma separated list of folders. Return only the exact name of the folder and no other text. So it should return something like Animals. Then it is going to run a Shell Script that's just going to use the mv command to move. Now there is a Move File Action here in Shortcuts. But unfortunately it didn't seem to be able to work in a lot of cases. In this case I really needed just something very simple and specific. So I'm just using a simple one line Shell Script. MV and then I'm creating the folder path from that original selection with the repeat item dot and the file extension. So that's just the original file as we're going through this loop here. Then I'm doing the same thing, this is exactly the same except I'm inserting slash and the response. So if it's like Animals it would be slash animals. In other words put it inside that folder.
Now I first tried using the On Device model to do this. It didn't work. It wouldn't look at the images. The same thing with Apple Intelligence here. But ChatGPT seems to do it just fine. So let's give it a go. I"m going to leave the folder open here and I'm actually going to Select All and do Command Right Arrow to open up all of these folders. Then I'm going to run it using Spotlight, Command Space Command 3 Sort Images, there it is. Going to run it and I'm going to select the folder. Open. You can see it started there. It has moved some in here. Like that. You can see it's just continuing to work one-by-one. It put one in Trees. It's got two in Animals now. We'll just let it go through all these and finish. (watching it continue to process). 
There is goes. Let's test this out. Let's turn on Show Preview. So we see the Preview here on the right. Then under Animals we see Animal, Animal, Animal, there's gorillas right there, animal, animal. Under Buildings, building, building, building, building and building. Under other, yep!. This is a picture of a beach here. There's no animal in it. There's no building in it. There are no trees in it.Then under Trees there's trees, more trees, more trees, more trees So it correctly identified every one of those images. I wouldn't expect it to be perfect every time. But neither would I expect myself to be perfect if I was doing this manually. This just took no effort on my part after I got it running. I could have created folders with any names that I wanted in here and had the same shortcut sort them. With a little more work it could work with things that aren't even images. Work with other kinds of documents so you can sort PDF's based on what a Large Language Model thinks each one is. 
So, of course, these are just examples. There are tons of completely different things you can do using Large Language Model inside of Shortcuts and there are tons of ways to modify these ideas. I'll include these four shortcuts at the post at Macmost.com so you can look at them yourself and try modifying them. It can be a little frustrating working with Shortcuts. Sometimes things, especially when you're using Large Language Model, don't quite seem to work the way you want them. But with a little patience and a lot of experimentation you can create some very useful things to help you with various tasks. Or if this is a little too advanced for you right now at least this gives you can idea of what's coming. Usually stuff like this starts out needing a lot of technical skill to build it. But it gets easier and easier as the years go by. Hope you found this useful. Thanks for watching. 

Files: 3368ShortcutsAI.zip

Comments: One Comment

    Sheldon
    12 hours ago

    Thanks bunches

Leave a New Comment Related to "How To Use AI In Mac Shortcuts"

:
:
:
0/500 (500 character limit -- please state your comment succinctly and do not try to get around this limit by posting two comments)