Keyboard Maestro Date Macro
Every now and again I need to figure out a simple date calculation. For example, I am writing up a wiki page and want to reference something next Thursday. I don't want to say next Thursday but I want to say the simple date format.
I encounter this enough times, that I decided to write a simple Keyboard Maestro macro. There are three types of date scripts that I wrote:
- Simple Date - Display the date x days from now. Added built in for Tomorrow, 2, 3, 4, 5, 7, 30, 60, 90, 100, 180 days
- Advanced Date - Put a number in the Clipboard and use that to display the date.
- Days Until - Put a date in the Clipboard, and then display the number of Years, Months, days until the event. If its in the past, then show the number of days that has past.
This set of macros are built-in date calculations. Simply by using the generic hotkey: day* and some number I can display that date. So if I wanted tomorrow, I would type in day1. If I wanted 100 days from now I would type in day100.
This macro makes use of the ICUDateTimePlus functionality that is part of Keyboard Maestro.
This single macro makes it easy to put in any number of days. Simply type in a number, copy/paste, and then type in day++. This also makes use of the ICUDateTimePlus function. The return display shows the Month, Day, and Year.
This macro is my date count down. If I want to know how many days until an event, I simply type in a date, copy/paste and then type in the trigger: day+++. The return value will show Years, Months, Days, Hours until the event. This also works for events in the past. So I can see how many days past since I graduated.
The PHP secondsToHumanReadable function, used in this example, can be found at stackoverflow.com.
This week Bare Bones released an update to BBEdit - bring the application to version 14.
It took 9 years to go from version 10 to version 14. So when BBEdit does a major update - it's a big deal. In this update, the big new feature is Notes.
One of the biggest features in this update is a Notes section.
For years BBEdit users would open up a blank document and just type away. When it came to saving the document, if they remembered, they would use the default name "untitled."
With BBEdit Notes, you can simply write away and don't have to worry about saving - it does it automatically! The name of the file is the first few words on the first line.
You can organize your notes into collections. (otherwise called folders) This makes it easy to view your data.
Seven Things I Learned about BBEdit Notes
Filename: While the name of the file displayed in the sidebar is the first few words of the first line. It's actually stored as a Globally Unique Identifier (GUID). The notes are not accessible in the Finder, they are in a package file in the finder in the BBEdit settings library. You can always use a simple trick to view the package file content - but why would you do that?
Emoji Filename - You can have Emojis in your filename! This is a creative way to make your notes stand out.
Dropbox Setup: If you are using BBEdit Dropbox sync configuration, you'll share the same Notes database between Macs. This is pretty useful. The problem is that notes created on a different Mac will show up in the Notes section using the GUID instead of the "friendly name." The workaround is to right-click on the note and select "Rename Note…" and assign a name. This name will carry over to the other Mac.
Collections: The Note collections works great on different Macs. You can nest collections. I setup up the notes to have two collections for the two computers that I use. This makes it easier to focus on the notes that may be important to me on a particular computer.
Search by Name: You can search for notes using the "Open File by Name." Only Noted created on the currently used computer will show up in the listing.
Search by Content: Use the new Notes check box in the Muti-file search dialog box to search through all your notes.
Opening Notes: You can open Notes in any BBEdit window. You don't need to use the Window->Notes feature to view a particular note. I find this useful as I have some reference documents and its great to have them available in the same window. The downside is that there's no indicator in the sidebar of what's a note file type and what's a plain file. I identify any filename that doesn't have an extension as a BBEdit note file.
Markdown: When you create a new Note it uses Markdown by default. If you are not familiar with the format, there is a Markdown Cheat Sheet in the Windows -> Palettes -> Markdown Cheat Sheet. This isn't new in 14, but useful to have when starting with Markdown.
Great Shortcuts to remember
Control - Option - Command - N -> Create a New Note (When you use this a few times, the keyboard combination makes sense.)
Shift - Command - F -> Multi-file search (Find Content in your Notes)
Lots of Other Changes
BBEdit 14 has a lot more changes other than Notes. Here are some other notable changes that I am excited about:
- Remove Blank Lines: One simple menu item to quickly cleanup those blank lines.
- Emmet Support: Simply install the Node.js and you can finally use Emmet within BBEdit.
- Markdown Images: When you drag images to a Markdown document, BBEdit will insert the correct image tag format - like it does for HTML.
- Text Factory: Replace All - Nice to see the history option. This makes it easy to implement a recent search/replace into a Text Factory action.
- Application Icon - Bare Bones has a new icon for BBEdit, but you can change it back to the old style in the Preferences.
- Pattern Playground - You can adjust the Search Pattern section. Now you can see more of crazy search pattern.
Go For the Upgrade!
BBEdit 14 is worth the upgrade. Still not sure? Why not try the the 30-day trial to explore how BBEdit can help you manage text easily.
"there isn't enough free space" error
Have you ever run into this kind of error message:
“There isn’t enough free space”
Usually this occurs when trying to save a change. The weird thing is that when you look at the disk space there’s plenty.
The lack of disk space can’t be the reason.
What’s Going On?
The other reason for the error is when the system clock is not set. Especially if the date is around 1970.
This may happen if your computer battery drained and it’s not connected to the internet.
Quick Easy Solution
Simply fixing the clock will fix the error.
Quickly Put the Computer to Sleep
Sometimes you need to put the computer to sleep without using the mouse. This happens when you're charging the mouse - or the mouse battery died.
Did you know that there’s a keyboard combination shortcut to quickly put your computer to sleep? This is a very useful combination to remember.
Download this graphic and use it as a quick reference to putting your computer to sleep.
Font Awesome Filter
Font Awesome is one of the popular online icon fonts. Web designers use it to make websites a little better.
You can easily search their collection for all sorts of creative icons. There are 7,865 icons in their collection - of that 1,609 are free.
One Bad Thing About Font Awesome Search
There is one downside to the Font Awesome search. When you find an icon, there's only one way to copy the HTML class - by clicking on the name. When you do this you get the whole style prefix not use the class name: Sample:.
That's useful when you want to add it for the first time. What if you only wanted the font class name to replace an existing font awesome style? You would have to paste the content and then delete the remaining class info. This can be a pain if you're replacing a bunch of icons for a redesign.
Keyboard Maestro to the Rescue!
I decided to write a Keyboard Maestro Macro to fix this situation. It's basically a regular expression that filters out everything outside of the quotes.
Here's the Macro:
Regular Expression Used
The nice thing about this Macro is that it can be executed by typing in the keyword: ".awesome " or using the filter menu in the Clipboard Switcher.
So now I can easily replace icons on a page with ones that I find on Font Awesome.
If there's a time when I am doing a lot of icon changes, I can change the macro to be easier to execute.
Not Using Font Awesome?
This is just a tip of how to use Keyboard Maestro for one instance. You may find another use of how this may help you have better copy/paste.
Turn off Notifications
Have you ever gotten those Notifications when you are sharing the screen? Perhaps you are sharing your computer and don't want people to peek into your text message notifications.
There's a simple way to fix that in macOS Big Sur
Big Sur Notifications
Turn Off Notifications
- Open up the System Preferences…
- Select Notification ( Located on the right side of the dialog under Family Sharing.)
Now you can turn off all notifications for a particular durations. Alternatively, you can turn off the notifications for particular apps.
Suggestion: turn off Notifications for Slack, Messages and Mail.
Keyboard Maestro Chrome Macro
Using Keyboard Maestro, I can set up a taskbar menu of various configurations. This makes it easy to launch Chrome with a particular setting whenever I want. I don’t have to memorize commands and I don’t have to launch a terminal editor to run these commands.
I simply select the chrome action that I want and instantly Chrome launches.
Sample Keyboard Maestro Action
Here is an example of one of the macros.
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --incognito
List of Chrome Command line Commands
You can get a list of all the Chrome Command options with some explanation on this site:
Word Count LaunchBar Action
Sometimes I need a way to count a selected group of text. Usually, it’s to see if it’s long enough for a particular field.
If it was on a website, I would copy that text into BBEdit or another text editor. Then I would look at the status bar to see the number of words or length of the copied text.
There has to be a better way,
Using the Action
Now when I need to get the information, I just follow these steps.
- Select the text
- Use the “Instant Send” keyboard short cut
- Click Tab
- Then type in “Word” and then click return.
I get instant info on my selected text.
Download the Custom Action
I figured other people may want to use this so I am making it publicly available.
Download the action. After downloading, double-click on the zip file to uncompress it. Then double click on the file to install in LaunchBar
Apple Quicktime has the ability to record video and audio files. This is a quick way to digitalize audio. For example, if you want to send an audio message in an email or a social media post.
There are two settings for audio:
|High||44100 Hz AAC audio|
|Maximum||44100 Hz, uncompressed Linear PCM 24-bit AIFF-C audio|
Four Things I Learned
The output audio is off, by default. You have to adjust the volume to hear the recording.
Shortcut for creating a new audio recording is Shift Command N
The recording settings that Quicktime starts with are the same as the default sound input. This is defined in the System Preferences - select Sound.
When you have the QuickTime Inspector open, it shows you the current settings that you have set up.
Three Reasons to Use Quicktime
- Fast way to record audio. Pretty much hit record and you're on your way.
- Installed on all Macintosh computers. If the computer has Quicktime, you have the ability to record audio. (Seems like a tool that Mission's Impossible's Ethan Hunt might use to record a confession.)
- Apple Script Support! You can write Apple Script or Automator action to record audio based on an action - such as setting up a recording to listen to mystery sounds at the office at midnight.
Three Reasons Not to Use Quicktime
- Limited recording scope. You can't define recording by application. For example if you want to record audio from Safari. This can be done using Audio Hijack.
- No Menu Bar or Dock Record Option. You have to have the App open and then type the keyboard shortcut and then record. Too many steps to record something quickly. Best solution to this is Simple Recorder.
- Limited Audio Configuration - You can only record using two settings High and Maximum. Use apps like Audacity for more configuration options.
Combine Files using BBEdit
Earlier this week I had a bunch of Apache log files that I wanted to combine into a single file. I was trying to figure out the best way to do it. A quick Google search showed me a solution from 2014. The purpose of this post is to say that it still works!
Here are the steps to quickly merge a bunch of files:
- Open up BBEdit
- Create a new Text Document (Command N)
- Go Under Edit menu and select Insert then “File Contents...”
- Select the files that you wish to add then click Insert
- Open up BBEdit
- Create a new Text Document (Command N)
- In the Finder drag and drop the text files into the BBEdit window
Using the Command Line
Another solution is to use the Cat Unix command in Terminal. Here's a sample of what that would look like:
cat access.log.* >> website.log
Sleep via Keyboard
One of the complaints that people have with Apple's Mouse is the location of the charging port. It's located underneath the mouse. This means that you can't use the mouse when you charge it.
So people end up just setting up a reminder to charge the mouse at night - once a week.
The problem with that is, if the computer is on, there's no way to quickly put the computer to sleep using the keyboard.
There's is if you have LaunchBar.
LaunchBar to the Rescue
LaunchBar has a built in action for Sleep. Simple type in the Command Space short cut and then type in Sleep and hit return.
Your computer goes to sleep.
Want to shut it down instead, Simple search for Shut and then hit return.
This is just one of many cool things that makes LaunchBar useful. I would highly recommend getting it.
Not in Spotlight
There's no action available in Spotlight. When you search for Sleep and select it, you are presented with the Energy Saver System Preferences.
Microsoft Teams Performance
Are you experiencing serious performance issues with Microsoft Teams? Are you having to close out applications like Slack and Chrome before you connect to a meeting?
Is Microsoft Teams maxing out the computer CPU?
Chances are that there's a simple settings adjustment that should be done. You'll need to disable the GPU hardware acceleration. On some older Macs, this may cause a considerable amount of slowness.
How to Disable GPU Hardware Acceleration
The GPU Hardware Acceleration is done in the settings panel of Microsoft Teams. Here are the steps:
- Open up Teams
- Click on your name on the top right and select settings
- Check the "Disable GPU hardware acceleration"
- Restart Microsoft Teams
This is what it should look like when completed:
One More Thing...
I would suggest restarting the computer. It's not necessary as part of the steps, but it couldn't hurt.
You should see improvement in the next meeting. Your computer won't go to a crawl and you shouldn't have any drop frames during the meeting.
Recently I connected a new camera to my iMac. After it was connected, I was wondering what applications had camera support that I could try out the new camera.
I know that Apple has apps like Quicktime, Facetime, and Photo Booth that support the camera. What about other Apps on my computer?
The easy way to find out what apps have Camera support is to look at the Camera permissions.
Finding Camera Access
Simple steps to find what Apps have Camera access:
- Go to System Preferences.
- Select the Security & Privacy category
- Select the Privacy Tab
- Select Camera.
Note: That you have to allow Applications to have permission to access the camera. If you haven't used the camera functionality in some apps, you may not have been asked for permission to use the camera.
Using the "New Movie Recording" in Quicktime Player was the fastest way that I found to get RAW video on the computer.
The keyboard shortcut: Option Command N is good one to remember.
This is the capture options that you have:
|High||H.264 video and 44100 Hz AAC audio|
|Maximum||Apple ProRes 422 video and Linear PCM audio|
Every now and then, I like to look back at some fonts in my CD collection. Some of the fonts that I have are outdated and can't be used in the latest macOS. There are a few that are still usable.
One of the fonts in my collection that I found interesting is the Zephyr Font. Benn Coifman, the developer, named the font after the Zephyr trains.
What caught my eye about the font is that it is very similar to the GoPro Logo font. Here's an example of the font:
After you have installed the files, "Zephyr.suit", "CZHer", and "CZHeralds.bmap" in your font folder, restart your word processor and print out a copy of "Zephyr Legend" (If you don't have Microsoft Word, I hope your translator can handle the new fonts). The top 2/3's of this file demonstrate the Zephyr font. At the bottom, you will see a couple of special characters that are in CZHeralds font. Note that the California Zephyr logo is split into three letters so it will have a lower probability of crashing your printer.
Zephyr font, all of its accompanying files, and train icon are © 1994-5 Benn Coifman. (that looks so nasty now that I typed it)
Three Things I Learned
This still works in MacOS 11.3 even though it is 27-years old (Created July 24, 1995). In fact, the copy I had was from a CD that was also about 27-years old. This means that I installed the same font that was released 27-years ago - I didn't just download it.
There is a similar font called Rail RoadRoman available on FontFreak. I wasn't able to find the Zephyr.suit font. There are other Zephyr fonts, but they didn't look the same.
Font was created using Altsys Fontographer 4.0.4D2 7/24/95
There are a couple of Easter Eggs in the font collection:
- There is a Burlington Route logo when you type in # - this is a reference to the Chicago, Burlington and Quincy Railroad. To get this simply type in Shift 8.
- There is a Face and a black cat. These are found by typing in Shift 2 for the face and Shift 3 for the cat. No clue on why these are there.
I am a huge fan of FontDoc - an application that lets you see the various font faces that you have installed. You can select the preview word, and copy and past the content into any document while maintaining the font format.
Recently I became aware of another Font Manger called TypeFace. So I thought I check it out and see how it might be better than FontDoc. TypeFace cost $19 and FontDoc is Free.
Six Things I Discovered
By default TypeFace uses "Hamburgefonstiv" as the preview word. This is a "filler text" use to test the appearance of a typeface. You can easily change it by toggle preview input.
I can "dig down" in the fonts and see all the characters.
There's no way to copy the preview text and font style into another document.
You can tag fonts! This is a nice way to organize fonts that you use for different projects. This way when you select a collection on the left, you can see all the fonts that is used. For example, you may have a collection for Facebook Posts, Holidays, or Videos.
You can easily import fonts from folders, this makes it easy to identify which fonts you want installed. When you find the one you want, right click on it and select Activate.
When you are done with a font, perhaps it's something that you don't use anymore, you can also deactivate it. This will remove it from the system font menu making it easier to find the fonts you want.
Will I Purchase this?
I am not going to purchase this application. It looks great and works great too! However, I really don't need this kind of font management.
I am more interested in finding font styles that work great for the text I am using right now. I don't think I'll be needing to create various collections.
Maybe someday, but not now.
This is a cool application, and I had fun playing around with it.
Available in SetApp
If you have an active SetApp subscription, you can just download TypeFace.