Alfred Workflow - Show "About This Mac" information
Sometimes you need to quickly query the Mac system version information or memory information. The normal operation is to click the Apple icon in the upper right corner of the screen =>About This Mac=>Then look for information on the corresponding Tab page =>Select copy, which is a bit troublesome.
So, taking advantage of the holidays, I quickly made a workflow to quickly obtain basic system information.
Screenshot
Note: Select a single item and press Enter to copy it to the system clipboard.
Download link::https://github.com/alanhg/alfred-workflows/tree/master/about-mac
Official link: https://alfred.app/workflows/alanhe/about-mac/
Implementation
Apple Script
to get system informationShell
splicing and printing the list structure supported by Alfred
The reason for choosing AppleScript and Shell is that the system is built-in, so it does not depend on any lib. If you are interested, you can view the source code after installation.
Apple Script Learning
When doing workflow development, sometimes Apple Script cannot be avoided, because AS can easily obtain some information at the system level, and at the same time, it can automate many App operations, such as Chrome’s new tab page, etc.
So how to learn Apple Script is a problem. I tried to read the official doc many times during development, but in the end I found that the document is still too bad to read. It is recommended to learn the newer Apple Script book directly. After all, the author has summarized it. , you can learn quickly. I have to say that the sentence official documents are always first-hand information
is not necessarily true, because sometimes the official documents are not necessarily valid.
Here is a book I recommend [Learn AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Third Edition](https://learning.oreilly.com/library/view/learn-applescript-the/9781430223610 /), the content is fairly comprehensive and can be used as an introduction.
At the End
- This is the 20th workflow I’ve written. It’s still a great sense of achievement to continue to develop new gadgets according to my own needs.
- Writing tool itself is also a kind of learning and exercise, so, keep