
Automating Tasks Using Apple Scripts and GPT with Automator In this video, we explore how to leverage large language models like GPT to automate repetitive tasks on Mac by writing Apple scripts. The tutorial encapsulates the process involved in creating a shortcut that opens a project directory in Visual Studio Code and then opens the terminal, thus saving a significant amount of time throughout the year. You will learn to use the OSX Automator to implement this automation, create new documents, select quick actions, search for Apple Scripts, double click on run Apple Script and save it. There are also instructions on how to create a keyboard shortcut and troubleshoot potential errors. 00:00 Introduction to Apple Scripts and GPT 00:18 Benefits of Automating Repetitive Tasks 00:46 Demonstration of a Simple Apple Script 01:31 Setting Up Apple Scripts on Your Machine 02:15 Creating a New Document in Automator 02:32 Naming and Saving Your Apple Script 02:55 Creating a Keyboard Shortcut for Your Script 03:51 Troubleshooting and Final Demonstration 04:26 Conclusion and Final Thoughts
--- type: transcript date: 2024-01-04 youtube_id: EXRRaUSzYXg --- # Transcript: GPT-Powered AppleScript Productivity Hack In 5 Minutes in this video I'm going to be diving into Apple scripts and how you can leverage a large language model like Chad GPT and gp4 to quickly write these Apple scripts for you that you can ultimately use to save a ton of time over the course of the year so if you're not familiar with apple scripts is there a powerful tool for automating repetitive tasks on Mac the thing that I like about Apple scripts is if you really break down even the smallest tasks like say if you have a task that takes 10 seconds that you perform 20 times a day over the course of year that's going to be a number of hours that you're going to spend doing that repetitive small task so while it might not seem like it's a lot of effort to spend 10 or 20 seconds on something it really adds up especially if it's something you do many times throughout the day so I'm going to show you a demonstration of one that I set up and all that it really does is I have a particular key binding where I click command G and what it will do is it will open my V vs code after I select that item that directory from the finder and then once vs code is open it's going to go ahead and run the keyboard shortcut to open the terminal for me so this is something that I do many times throughout the course of a day I hop around different projects I open different vs code environments and almost always I want to have the terminal open this is something that's going to save me a ton of time just this small little script that I set up to set these up just think of an idea of a particular task that you'd like to automate go ahead to something like chat GPT this should work pretty well on something like GPT 3.5 as well and just describe that task to the best of your ability don't worry if it doesn't get it all on the first shot you can always go in and iterate and try different versions of it but once you have something that looks like it might be within the range of you know the action that you're trying to perform just grab that scen script and then what we're going to do is we're going to go ahead and open up automator now once you've opened up automator you're going to create a new document and within the document you're going to click quick action so once you've selected quick action what we're going to do is we're just going to search for Apple script and we're going to double click on run Apple script here so once you have that you can just copy the script from the llm and you can go ahead and save it out so you can really name it whatever you want so in this case I'm just going to name this open vs code and I'll just call it newest because I do have this already set up but just so you can see the newest version from the system preferences so once you have that you just need to head over to the system preferences and if you want to create a keyboard shortcut like I did if you just scroll down to the bottom after selecting services from the keyboard shortcut menu there's a few different things you need get to to actually get to the services here now if you scroll down to the bottom window you see some of the ones that I had set up here so if you're if you have this window open and it's not right there if you just simply exit out of the system preferences and then you open it again you go to Services you scroll back to the bottom and you'll see that newest version that I just saved out so you see here I have that keyboard a shortcut bound to this one you can go ahead and turn them off if you'd like if you want to get rid of them you can just double click and erase them and let's say I want to add that shortcut to this one now that that is registered now the one thing to note that you might run into is if you run into errors when you actually try and invoke the command so say if it's from uh the finder that you're performing the action you might actually have to go within your privacy settings and make sure to enable the application that you're running the action on so that's just an aside but I'll just demonstrate one more time so once that's all set up and I go ahead and run the command you can see that now it's bound to that newest one that I set up so it's one of those things where well it might be these small little tasks if you can save time on these repetitive things over the course of the year you're ultimately going to have less things to think about throughout the course of your day and you're ultimately going to be saving a ton of time so just a short one today hopefully you found this video useful if you did please like comment share and subscribe and otherwise until the next one
Weekly deep dives on AI agents, coding tools, and building with LLMs - delivered to your inbox.
Free forever. No spam.
Subscribe FreeNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.