strlen.awf
                                
                                 strlen.awf copied to clipboard
                                
                                    strlen.awf copied to clipboard
                            
                            
                            
                        An Alfred workflow that counts the number of characters and bytes in a string.
Contents
- strlen.awf: an Alfred 3 workflow for measuring string length
- Installation
- Prerequisites
- Installation from the npm registry
- Manual installation
 
- Customization
- Hotkeys (keyboard shortcuts)
- Keywords
 
- License
- Acknowledgements
- npm dependencies
 
- Changelog
strlen.awf: an Alfred 3 workflow for measuring string length
strlen.awf is a simple Alfred 3 workflow for counting the number of characters and bytes in a string (piece of text):
It comes with a hotkey (global keyboard shortcut) that operates on the
selected text in the currently active macOS application; alternatively, use
keyword sl.
Both character and byte count (to see the actual storage requirements of UTF-8-encoded text containing multibyte characters) are measured simultaneously, e.g.:

- Pressing ↩ (Return) on the count of interest copies it to the clipboard (as a mere number).
- Pressing ⌥↩ (Option + Return) additionally pastes the number into the active application.
Installation
Prerequisites
- macOS (OS X
- Alfred 3 with its paid Power Pack add-on.
Installation from the npm registry
Note: Even if you don't use Node.js itself: its package manager, npm, works across platforms and is easy to install; try
curl -L https://git.io/n-install | bash
With Node.js installed, install the package as follows:
[sudo] npm install -g strlen.awf
Note:
- Whether you need sudodepends on how you installed Node.js and whether you've changed permissions later; if you get anEACCESerror, try again withsudo.
- Alfred 3 will prompt you to import the workflow - select a category (optional), and confirm.
- After importing, proceed with customization below.
Manual installation
- Click here to download the installer.
- Open the downloaded file: Alfred 3 will prompt you to import the workflow - select a category (optional), and confirm.
- After importing, proceed with customization below.
Customization
Note:
- Custom hotkeys and modified keywords are retained on reinstallation / upgrade.
- To customize a workflow again later, click on Alfred's menu-bar extras icon,
(the bowler hat symbol), select Preferences..., switch to theWorkflowstab at the top, then locate the workflow in the list on the left.
Hotkeys (keyboard shortcuts)
Alfred initially installs a workflow without actual hotkeys, so you must assign them manually:
- Double-click the Hotkeyelement(s) of interest, click on theHotkey:input field, and press the desired key combination.
Keywords
Optionally, you may customize the keyword(s) a workflow comes with:
- Double-click the KeywordorScript Filterelement(s) of interest and modify the value of theKeyword:input field.
License
Copyright (c) 2015-2016 Michael Klement [email protected] (http://same2u.net), released under the MIT license.
Acknowledgements
This project gratefully depends on the following open-source components, according to the terms of their respective licenses.
npm dependencies below have an optional suffix denoting the type of dependency: the absence of a suffix denotes a required run-time dependency; (D) denotes a development-time-only dependency, (O) an optional dependency, and (P) a peer dependency.