pacmax beta

Alfred Pac by squatto on GitHub

imessage 2fa

iMessage 2FA Workflow for Alfred

From their README

iMessage 2FA Workflow for Alfred

Find two-factor authentication codes in your recent iMessage messages.

Screenshot

Requirements

  • php must be installed on your system
    • macOS has not had php preinstalled since Monterey (v12)
      • This is also the case for macOS Ventura (v13), Sonoma (v14), and Sequoia (v15)
    • We recommend using Homebrew to install php
      • To install Homebrew, follow the instructions on the "Install Homebrew" section of the Homebrew website
      • Once you have installed Homebrew, install php by running brew install php
  • You MUST grant Full Disk Access to Alfred

Installation

  1. Download the latest version of the workflow
  2. Install the workflow by double-clicking the .alfredworkflow file
  3. You can add the workflow to a category, then click "Import" to finish importing. You'll now see the workflow listed in the left sidebar of your Workflows preferences pane.

Configuration

  • By default, only messages received in the past 15 minutes will be searched
  • You can change how many minutes to look back by changing the look_back_minutes workflow variable
  • Tutorial: How to set workflow variables

Workflow Variables

Usage

Type 2fm to view the most recent two-factor authentication codes from iMessage messages.

Select a 2FA code and do one of the following:

  • Press `` to copy it to your clipboard
  • Press ⌘+ (command + enter) to copy it to your clipboard and paste it into the active app window using simulated keystrokes
    • Some websites (e.g. Wells Fargo online banking) don't support pasting a 2FA code, so this will instead simulate typing the code
    • In order for this to work, you MUST grant Alfred automation access to System Events. If you haven't already done so, you will be prompted to grant access. See here for more information about Alfred automation.
  • Press ⌥+ (option + enter) to copy it to your clipboard and paste it into the active app window using the system paste (similar to pressing ⌘+V)

Compatibility

This workflow was developed for use with Alfred 5. It also works with Alfred 4.

Contributors

A huge thank you to our contributors!

Latest release

11 earlier releases
  • 1.2.91 year ago, 3.3 MBDownload

    What's Changed

    Full Changelog: https://github.com/squatto/alfred-imessage-2fa/compare/v1.2.8...v1.2.9

  • 1.2.85 years ago, 3.0 MBDownload
    • The php binary is located on your system to cover situations where it isn't in your PATH
    • If the php binary can't be found, an error message is displayed
    • Match 4-8 digit codes followed by "is your [...] code". For example: "2773 is your Microsoft account verification code"
      • Thanks @luckman212 for the PR!
  • 1.2.65 years ago, 2.5 MBDownload

    Match 3 and 4 digit codes if they immediately follow "code" or "is" (e.g. "your code is 1234", "enter code 573 to log in")

    Thanks @luckman212 for the PR!

  • 1.2.55 years ago, 2.2 MBDownload
    • By default, only messages received in the past 15 minutes will be searched
    • You can change how many minutes to look back by changing the look_back_minutes workflow variable
    • Tutorial: How to set workflow variables

    Thanks for the suggestion @luckman212 👍🏻

  • 1.2.45 years ago, 2.0 MBDownload
    • Detect more patterns, especially those that include extended characters
      • Thanks @caidwang for the bug report!
  • 1.2.36 years ago, 1.8 MBDownload
    • Detect 4 digit codes if preceded by "code:" or "is:"
      • Thanks @615don for the suggestion! (#13)
    • Detect 6 digit codes in XXX-XXX format (e.g. Stripe 2FA messages)
  • 1.2.26 years ago, 1.6 MBDownload
    • Use AppleScript to simulate keystrokes instead of using the system paste functionality. This fixes a problem with some websites that monitor keystrokes and don't consider pasting the code as a valid input (e.g. Wells Fargo online banking)
      • Thanks @cmer for the change!
    • Add ⌥+enter (option + enter) to use the system paste functionality
  • 1.2.16 years ago, 1.4 MBDownload
    • Fixes a bug that was causing codes that were immediately followed by a period to not be found (e.g. "your code is 123456."). This fixes issue #7. Thanks @tmm for the bug report and @manonstreet for the fix!
  • 1.2.06 years ago, 1.2 MBDownload
    • Add comprehensive error checking and reporting
    • Support Google 2FA codes: G-000000
  • 1.1.06 years ago, 1.0 MBDownload
    • Removed the Carbon dependency
    • Removed everything related to timezones
    • Only supports Alfred 4
  • 1.0.06 years ago, 1.0 MBDownload

    Initial release