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....

Clearing the Terminal in VS Code

When using VS Code as your development environment, you may encounter situations where you need to clear the terminal. While the commonly used cmd-k key combination typically clears the terminal in other applications, it doesn’t work as expected in VS Code. To clear the terminal in VS Code, you can follow these steps: Press cmd-shift-P to open the command palette. Search for the “Terminal: Clear” command and select it. If you have previously set up cmd-k as the shortcut for clearing the terminal but it isn’t working, there might be a setting conflict....

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....

Linux Commands: Clear

In this guide, we will explore the clear command, which is used to clear the terminal screen. By using the clear command, you can remove all the previous commands from your current terminal session. To clear the screen, simply type clear in the terminal and hit enter. Once you do that, the entire screen will be cleared, and you will only see the prompt at the top. This is especially useful when your terminal is cluttered with previous command outputs and you want a clean slate to work with....

Linux commands: ps

A comprehensive guide to using the ps command in Linux to list and manage running processes. At any given time, your computer is running numerous processes. To inspect and manage these processes, the ps command comes in handy. It provides a list of the processes currently running in the system. The displayed list represents the user-initiated processes in the current session. For example, you may see multiple instances of the fish shell, mainly opened by VS Code within the editor, and an instance of Hugo running the development preview of a site....

The Command Line for Complete Beginners

Introduction to using the command line for complete beginners Using a computer with a mouse or touchpad is convenient, but there was a time when computers were only accessible through commands typed in a terminal. Even with today’s advanced technology, the terminal is still a powerful tool that unlocks capabilities beyond what a Graphical User Interface (GUI) offers. The terminal, or Command Line Interface (CLI), is not just for programmers. It is essential for any professional computer user....