New Mac Tips Revisited

I went back and found an old post, New Mac Tips and thought it was a good time to make a follow up post with my latest thoughts.

Since 2018 I have been using a MacBook Pro as my main device at work and so I have a few different things that are useful for that use case.

JAVA

macOS and JAVA is a post I made talking about the special way to manage JAVA JDK installations in macOS.

Finder

Previously I recommended updating the default directory when opening finder, but adding on to that I also recommend adding your home directory to the “Favorites” section in the side bar by dragging the folder icon for it into the section. Besides that under the View menu when Finder is activated be sure to “Show Path Bar” and “Show Status Bar” options. The two bars will show up at the bottom of each Finder window to give you useful information about the current directory.

There are a few different Finder features that are enhanced by using different modifier keys.

For example, if you are dragging a file and hold down the option key, when you drop the file it will create a copy of the file in the place you dropped it. It save you the trouble of copy/paste or file duplicate.

The menu items in the menu bar will also change as you press the modifiers while the menu bar is open. Go to Finder click on the File menu and press shift or option or both to see the different options available.

There is a great accelerator for creating a new folder for a bunch of selected item. Select the files by lassoing them or Command clicking on each file, then press Control+Command+N. A folder will be created, the files will be moved into it and the folder name will be in focus for renaming.

By default Finder will not show hidden files and folders, this includes those that start with a period e.g. .bash_profile or .m2, and other system folders e.g. /Library. You can easily toggle this view on and off with Shift+Command+Period.

If you lose track of your cursor just shake it move your mouse back and forth quickly and it will grow to show you where it is.

Screenshot app

One of the most used apps for me is probably the Screenshot app. Here is the Apple Screenshots documentation. You can launch the full version of the app by pressing Shift+Command+5. I only use the full version if I am doing screen recordings or modifying the settings for the app. There are two key options here based on personal preference. The first is the save location for the screenshots, which defaults to the Desktop. The second is whether it pops up a little thumbnail after you take a screenshot. I always save to Desktop and have the thumbnails turned off.

The good news is you don’t have to launch the app to take a screenshot and can instead use keyboard shortcuts at any time for taking them. There are two main tyes of screenshots: entire screen (Shift+Command+3) and portion of the screen (Shift+Command+4). By default that will save the image to a file, but if you add the Option key to either of those it will copy directly to the clipboard. My most common used key combination is Shift+Option+Command+4 to capture a portion of the screen to the clipboard.

Preview

Preview is the default app for viewing and modifying images on macOS. It is usually where I go to quickly markup files before sharing them or for quick image editing tasks.

The Markup toolbar can be accessed via a button in the toolbar or from the View menu. It includes tools for adding shapes (arrows, boxes, circles), drawing, adding text and selection.

Preview is also the default app for viewing and editing PDFs. You can’t modify the body of the PDF, but you can enable the Thumbnail view to manage the pages in a PDF (paste, reorder and delete).

Terminal

I have always used BASH, so when macOS moved to zsh, I had to modify the default shell to /bin/bash via the Terminal Settings. The downside is the Terminal will show a warning every time you open a new window. You can disable that by adding export BASH_SILENCE_DEPRECATION_WARNING=1 to your .bash_profile

This is kind of a Finder thing, but if you have are viewing a Folder in Finder you can right click on it choose Services > New Terminal at Folder. It will open Terminal with that folder.

Conversely if you are in terminal and want to open the current directory in Finder just run open . and it will open in Finder.

Dock

As with most things in macOS you can drag and drop apps around the Dock to match your desired organization. If you right click on the apps you can also choose to “Keep in Dock”, so they will stay there always.

There is a Downloads stack at the end of the Dock next to trash which gives you easy access to your Downloads folder. If you click on it then it will show a popover of the files. You can change the settings for it by right clicking on it. You can change the sort order and also the view when it pops up. I prefer sorting by Date Added and Grid view. If you want to open the folder in finder you can just hold Command+Option and click on it.

Control Center

At the top right of the menu bar is the Control Center where there are several controls for Sound, Display, WiFi, etc. There are also other menu bar items to the left of it. You can rearrange items in the menu bar and in Control Center by holding Command and dragging them around. If you don’t want something to be in the menu bar you can just drag it out of the menu bar.

Assorted

If you press Control+Up then you can see all of the open windows in the current space.

If you drag a window to the left or right edge of the screen it will resize to take up that half of the screen. If you drag it to the top or bottom corner then it will take up that quarter of the screen. If you move the window again it will go back to its original size.

The yellow button in a window will minimize it to the Dock, you can bring it back by clicking it in the Dock or if it you bring up the app switcher with Command+Tab you can get it out of the Dock by tabbing to the app and holding Option while you release Command.

macOS Screenshots and the Touchbar

tl;dr  If you change the screenshot destination setting to anything besides Desktop on the Touch Bar it will override the default behavior of the keyboard shortcut and use your setting from the Touch Bar.

I recently got a 2018 13” MacBook Pro with the Touch Bar and it has been an amazing machine.  At first I didn’t really love the Touch Bar, but the more I try to use it the better it gets.  The idea of replacing those old function keys with a dynamic display is smart, although I would prefer a physical button for the escape key. 

I was taking a selection screenshot (command-shift-4) today and noticed that the Touch Bar had a couple options on it for the destination of the image (Desktop, Documents, or clipboard) and the thing to capture (selection, window, screen).  I always struggled with the keyboard shortcut for copying to clipboard (ctrl-command-shift-4), so I was delighted to be able to trigger the “file” destination shortcut, but change it to the clipboard using the Touch Bar.

Fast forward to later in the day… I was using an external monitor with the MacBook closed and tried to do a selection screenshot (command-shift-4).  I selected the area to capture, let go and waited for the file to appear on the desktop, but nothing happened.  I tried again, but tried pasting into Messages and to my surprise the image showed up.  Turns out if you change the screenshot destination setting to anything besides Desktop on the Touch Bar it will override the default behavior of the keyboard shortcut and use your setting from the Touch Bar.

In order to change it back you have to get the screenshot controls to appear on the Touch Bar and set the destination to Desktop.

MacOS, Maven and Tilde Folders

I recently set up a new MacBook Pro for development and installed some developer tools like Java and Maven.  After checking out my source code from Subversion and building it using Maven a folder with the name tilde (~) appeared in the same directory as my source code.  I deleted the folder and a little while later I noticed it was back.  After some digging around I found that setting the path of my local maven repository in my settings.xml file so it started with a ~ for my home directory was the problem.  Every time I ran a build it was trying to put a new local repository in a tilde directory of the working directory.  After updating the path to use /Users/{username} it stopped creating the tilde folder.