0%

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

  1. Apple Script to get system information
  2. Shell 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

I really like the sense of achievement obtained by open source projects. In the past year, I have insisted on doing several open source projects, and I have also gained some stars from netizens, some also add WeChat, raise requirements, the charm of open source is here.

For example, if someone stars your project, it would be better to be able to receive telegram notifications in time, because the NPM package release notification has been done before, so this is easy to do, but because there are still some pitfalls, so mark here, maybe help some friends.

Configuration

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
on:
watch:
action: started
env:
REPO_NAME: ${{ github.event.repository.name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Notify
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: Someone stars **${{env.REPO_NAME}}** repository, see [here](https://github.com${{github.repository}}).
format: markdown

Configuration Instructions

There are many variables in GitHub Action, ${{ github.event.repository.name }}, ${{github.repository}} are context variables, which do not need to be configured, use directly, ${ { secrets.TELEGRAM_TO }} is a warehouse configuration variable, which needs to be set in the warehouse settings.

GITHUB_SERVER_URL is not Work?

The official website has said that the default environment variable is $GITHUB_SERVER_URL, and the usage method is $GITHUB_SERVER_URL, but if it is written in the above message, it will not work, the reason is that the environment variable is used when using the shell, if it is a job The github context needs to be used in the step

Telegram Configuration Parameter Acquisition

  • TELEGRAM_TOKEN

    • Through @BotFather, create a Bot to obtain, note that the complete format of the Token will be like this 12345678:BBFntuCD6nRx1ZIYZ-eCyfP1UO4FeAjnz2M
  • TELEGRAM_TO

    • Need to send a message to the bot, make sure chat is turned on

    • Visit https://api.telegram.org/bot$TELEGRAM_TOKEN/getUpdates to get the chatID in it

Write at the End

As above, you can realize the telegram notification, start!

I love Alfred so much that once I find one of my efficiency needs, I will study the feasibility of Alfred. If it is feasible, I will immediately find a third-party or my own custom development. Until today, I have developed 16 workflows, and there are also many experience posts, so proud of myself.

Whether it is self-developed or third-party, most of them are used frequently in my daily life. Share here, maybe I can help some friends.

Notice

Click the workflow title link to access the download page. The download page will have an introduction, so I won’t go into details here, just show the main functions with GIF animation

Workflows:

2FA-Read Code

https://github.com/alanhg/alfred-workflows/blob/master/2fa-read-code/screenshot.gif?raw=true

About Mac

https://github.com/alanhg/alfred-workflows/blob/master/about-mac/screenshot.gif

App ID

https://github.com/alanhg/alfred-workflows/blob/master/appid/appid_2.gif?raw=true

Coinc

https://github.com/tomy0000000/Coinc/blob/main/src/images/demo.png?raw=true

Airdrop

https://static.1991421.cn/2024/2024-05-21-223808.gif

Dash

Eudic Tools

GitHub

JetBrains - Open Project - v3

New File

OCR

Pic Uploader

Surge

Write at the End

  • Efficiency tools are not the best, just fit
  • In the actual installation and use, there may be tracks, there are the following solutions
    • Here, I maintain a lot of issues that I have encountered in actual use Click here to search if there are related problems, and welcome to raise issues
    • Ask questions on the download page of the above workflow, enthusiastic community enthusiasts or authors will reply

I have always liked to use Alfred’s Snippet to input commonly used text blocks, and also support configure some parameters, which can usually save the time of inputting repeated text. For example, we often did CR before and we needed a simple summary at the end. In order to improve the efficiency of the summary, I made a Snippet.

But the downside of Snippet is that Alfred only exists on MacOS, and I am unhappy as an Apple user. Because the Apple system itself has text replacement function, I had to place a part of the text block in the system layer configuration, so that it can be supported across Apple devices. However, if use the two at the same time, will cause issues. So I thought about the cooperation between the two, and marked it here.

Alfred Snippet VS Apple Text Replacement

First, let’s sort out the differences between the two.

  1. Platform limitations

    • Alfred only supports Mac, there is no iOS version. There is a remote App, but the essence is only to remotely control some functions of the Mac version App, not a real iOS ported version
    • Apple’s text replacement will be synchronized to each device using iCloud, and once modified, all devices can be used immediately
  2. Functional limitations

    • Alfred’s Snippet itself supports various variables. In addition, it can use workflow to achieve more powerful replacement, and it can also control the position of the final cursor. In a word, it is powerful
    • Apple’s text replacement is relatively simple, just replace between strings
    • On the Mac system, text replacement in EN state does not work in all apps, such as MacDown, or the address bar of Chrome, but the above apps work in Chinese. Comparing devices, such as iPhone and iPad, work both in EN and Chinese. It is estimated that there is an App adaptation problem with text replacement.

Uniform convention

text prefix

Although text replacement is good, if the text itself has no features, it will often be accidentally triggered in actual high-frequency input. In order to solve this problem, it is necessary to formulate a prefix, here I use t, such as codereview, it will be tcodeview.

There are some considerations for this

  1. Letters are better than special symbols

    Because this text replacement scheme is often used in the iPhone, and the layout of the mobile phone keyboard determines the letter prefix, the text replacement can be quickly implemented without switching the keyboard, which is more efficient.

  2. t means text, better associative memory, friendly

Text Phrase Division

  • As mentioned above, Alfred does not cross terminals, so for daily simple text phrases, such as mobile phone number, home address, email and other high-frequency input simple text, configure it at the Apple system level
  • For complex ones used at work and mainly solved on the desktop side, configure in Alfred

Effect

Alfred Snippet

Apple Text Replacement

Write at the End

Constantly polishing tools, high efficiency is the king

I have combed before, my commonly used APP, commonly used hardware. This time, I will sort out the plugins that Chrome uses every day, and share my experience.

For the plugins I use, they can be roughly divided into two categories.

To be continued

Daily Used

  1. 1PasswordX -Password Manager

Use with 1Password Mac and iPhone multi-terminal apps. Usually, the shortcut key is used to call out and quickly fill in the password.

  1. AdBlock

The well-known ad blocking tools. Of course, some cannot be blocked, such as iQiyi, and some of them still choose paid services appropriately.

  1. Grammarly for Chrome

For someone with poor written English, it’s fantastic, and is free. Sometimes it is often necessary to write questions and comments on platforms such as GitHub or medium. With this plugin, combined with Google Translate, at least basic communication problems are solved.

  1. Synology Download Station

With the use of Synology at home, you can usually click on a movie download address to trigger the download task.

  1. Vimium

For some operations on web pages, you can use vim habits, such as G to quickly move to the bottom, yy to copy the current URL. After these operations are proficient, part of the efficiency can be improved.

Note that because the shortcut keys conflict with the GitHub webpage shortcut keys, you need to add exclusion rules

  1. Tampermonkey
    This plug-in, I personally feel that as a supplement to all plug-ins, uses JS to achieve personalized operations on the target site collection. For example, a movie download website that I often visit, it loads some advertising JS, which leads to entering the website, clicking on the movie, and always jumping to a rogue website first, which is very annoying. So this plugin comes in handy.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    (function() {
    'use strict';
    window.setTimeout(()=>{
    const ads = document.querySelectorAll('a[id^="cs_ap_"],div[id^="cs_DIV_cscpvric"],iframe');
    ads.forEach(item=>{
    item.remove();
    });
    document.body.onkeydown=null;
    },200);
    })();
  2. uBlacklist

    Blocks sites you specify from appearing in Google search results.

  3. Modern for Wikipedia

    Enhance your Wikipedia experience with a beautiful, clean, modern design.

Developers

  1. Wappalyzer

​ A must for web developers to get an overview of the technologies used by the target page

  1. [Open SEO Stats](https://chrome.google.com/webstore/detail/open-seo-stats formerly-pa/hbdkkfheckcdppiaiabobmennhijkknn)

For a website you are visiting, you sometimes need to know the basic information of the website, such as which country the corresponding service is in, IP information, and so on.

  1. React Developer Tools

    A must for react developers, needless to say.

  2. Redux DevTools

    A must for redux developers, needless to say.

Write at the End

The above are the plug-ins that I commonly use, or the same sentence, don’t use tools for the sake of tools, and don’t use efficiency for the sake of efficiency. It is the best to find the one that suits you and solve the actual problem after being familiar with it.

I have spent some time to check my personal Mac Apps, so provide a list for the references.

Will keep updating

https://static.1991421.cn/2024/2024-06-13-221548.jpeg

Notes

  1. Some are paid apps, but there are also many free and open-source options. Ultimately, the value of an app is in its output. These apps have significantly helped my work/life, and they are worth the purchase.
  2. In order to save money, for some paid apps, I use open-source licenses.
  3. If you can afford it, suggest to buy and support the official versions.
  4. The list is periodically updated, so some apps may be replaced.
  5. When constantly choosing and refining apps, I have one feeling: apps to us are like swords to a swordsmen. It’s not about the quantity but about being handy and sharp. So, choose the ones that suit you best, learn them deeply, and ultimately improve your efficiency, making work and life better.

App List

Alfred

  • Function: An application launcher and productivity software, Alfred is similar to macOS’s Spotlight function, but offers a higher degree of customizability and extensibility through its action system known as “workflows”.
  • Pricing: Paid
  • Note: It it recommended to buy the Mega version; the author keeps updating, and the community is active

Dash

  • Function: An API Documentation Browser and Code Snippet Manager
  • Pricing: Paid
  • Note: High upgrade cost, recommend not upgrading if no special needs

Moom

  • Function: Window management
  • Pricing: Paid
  • Note: None

Bartender

  • Function: Menu bar app icon management tool
  • Pricing: Paid
  • Note: None

Fantastical

  • Function: The calendar app, supports natural language input and calendar subscription
  • Pricing: Paid
  • Note: None

Surge

  • Function: Proxy tool
  • Pricing: Paid
  • Note: None

1Password

  • Function: The Best Password Manager
  • Pricing: Paid
  • Note: Strong performance in password management

Telegram

  • Function: Secure communication, the best IM tool so far
  • Pricing: Free
  • Note: Bots and channels are powerful

WeChat

  • Function: Office IM
  • Pricing: Free
  • Note: None

Chrome

  • Function: Browser and front-end development debug tool
  • Pricing: Free
  • Note: None

Typora

  • Function: Markdown Editor
  • Pricing: Paid/one-time purchase
  • Note: You can sync md files on multiple devices with iCloud

keka

  • Function: The macOS file archiver, supports password protection
  • Pricing: Free
  • Note: Free on the official website, paid on AppStore

Things

  • Function: GTD, a great todo list
  • Pricing: Paid
  • Note: None

PostMan

  • Function: Network debugging
  • Pricing: Free
  • Note: None

iTerm2

  • Function: Terminal app
  • Pricing: Free
  • Note: None

Snipaste

  • Function: Screenshot
  • Pricing: Free
  • Note: None

PicGIF Lite

  • Function: Convert photos and videos into incredible GIFs quickly.
  • Pricing: Free
  • Note: None

Affinity Photo 2

  • Function: Graphic design, photo editing
  • Pricing: Paid/one-time purchase
  • Note: Purchase on the official website; platform-specific, unlimited devices. cheaper than Photoshop.

Microsoft Remote Desktop

  • Function: Remote desktop
  • Pricing: Free
  • Note: Not available in China, need download from foreign stores

Eudic 欧路词典

  • Function: Dictionary
  • Pricing: Paid/one-time purchase
  • Note: None

FileZilla

  • Function: FTP
  • Pricing: Free
  • Note: Choose the first version tar.bz2 format, download and extract

Karabiner-Elements

  • Function: Key remapper
  • Pricing: Free
  • Note: None

Spotify

  • Function: Music app
  • Pricing: Subscription
  • Note: A free version is also available, with limited features and ads

iMazing

  • Function: iOS device management/file management
  • Pricing: Paid
  • Note: None

WebStorm

  • Function: IDE, further enhances productivity with plugins
  • Pricing: Paid
  • Note: Open-source project license

DataGrip

  • Function: Database, more efficient than Navicat, rich in features, supports plugin development, highly expandable-consistent design and experience with IDEA, low learning curve.
  • Pricing: Paid
  • Note: Open-source project license

CodeWhisperer

  • Function: Command auto-completion tool, previously known as Fig
  • Pricing: Free
  • Note: Terminal command auto-completion

Office 365

  • Function: Office suite
  • Pricing: Paid
  • Note: None

Visual Studio Code

  • Function: Lightweight text editor
  • Pricing: Free
  • Note: None

Docker

  • Function: Manage container applications
  • Pricing: Free
  • Note: None

Write at the end

There is no best, only better. What suits you is the best.

Docs

I’ve been using Alfred for several years and believe it is a powerful tool. I summarize my most used features for your reference and perhaps to help the follower.

Alfred is my primary entry for searching and querying on my Mac. Every operation I perform start from this single input box.

Instructions

The following tutorial applies to Alfred 4/5

let’s start!

Read more »