AppleScript by Example: Episode 1

If you’re new to AppleScript like me, you might find it challenging to grasp at first. The mental model behind AppleScript is quite different from what most developers are used to. Nevertheless, there are times when you’ll need to write AppleScript code to automate tasks on your Mac. Today, I had to write an AppleScript, and after some googling, stackoverflowing, and chatgpting, I came up with the following solution: tell application "Finder" set currentFinderWindowPath to (POSIX path of (target of front window as alias)) end tell tell application "Terminal" do script "cd " & currentFinderWindowPath activate end tell Let’s break down what this script does so that I can refer back to it in the future....

How to Add an \"Open in Terminal\" Icon in macOS Finder

If you’re a macOS user and frequently open folders in the Terminal, you might find it convenient to have a dedicated “Open in Terminal” icon in the Finder. This tutorial will guide you through the process of adding this icon to your Finder toolbar. Step 1: Open Automator and select “Application” when prompted to choose a type of document. Step 2: Search for “Run AppleScript” in the list of available actions and add it to your workflow....

How to Hide a File or Folder in macOS Finder

As a macOS user, you may sometimes come across unnecessary system folders, such as the “Public” folder, in your home directory. Although you can’t delete these system folders, you can hide them from view. In this article, we will show you how to easily hide a file or folder in macOS Finder using the terminal. To get started, follow these steps: Launch the Terminal application on your macOS device. In the Terminal window, type the following command and press Enter: chflags hidden <path> Replace <path> with the path to the file or folder you want to hide....