Releases: dbacks2196/alfred-search-open-finder-windows
Releases · dbacks2196/alfred-search-open-finder-windows
Search Open Finder Windows — Alfred Workflow v2.1.1
Version 2.1.1 - Change Log
Features
- Refinements to icons
- Now uses macOS' built-in "Network" icon
- Improved handling of nonstandard windows when Finder is not in focus
Performance
- Consolidated string matching blocks
- Replaced regular expression matching with zsh-optimized
case
statements and glob patterns - Implemented more concise, zsh-native parameter expansion
- Explicitly defined remaining executables with their paths to eliminate
$PATH
lookup
Codebase
- Replaced unnecessary associative arrays with regular arrays
Bug fixes
- Resolves an issue where the displayed name of the iCloud Drive folder would appear incorrectly
- Resolves a rare issue that would cause the script filter to hang if a "Get Info" window's inspected item does not have a real UNIX path
Full Changelog: v2.1.0...v2.1.1
Search Open Finder Windows — Alfred Workflow v2.1.0
Version 2.1.0 - Change Log
Features
- Custom logic now extracts the specific Mac's icon from macOS' /System volume
- Includes a fallback for pre-2023 Mac models
- Added icon for "Documents" folder
Performance
- Replaced all
basename
calls with zsh parameter expansion
Full Changelog: v2.0.1...v2.1.0
Search Open Finder Windows — Alfred Workflow v2.0.1
Version 2.0.1 - Change Log
Features
- Added icons for AirDrop and network windows
- Updated colors of existing icons
Performance
- Moved all special Finder window type handling from AppleScript to zsh
Bug Fixes
- Fixes an issue where windows would be indexed incorrectly if more than 9 are open
Full Changelog: v2.0.0...v2.0.1
Search Open Finder Windows — Alfred Workflow v2.0.0
Version 2.0.0 - Change Log
Major Features
- Live IPC with AppleScript streaming using FIFO
- Processes AppleScript output in real-time via a named pipe instead of waiting for completion.
- Dramatically improves performance with many open windows
- Uses
script -qF
to capture live AppleScript output to FIFO - zsh now has access to the first window immediately after AppleScript detects it.
- Dynamic trap system with
trap_that()
- Creates a temporary script that runs on exit and self-destructs
- Commands with variable names are appended to the trap script as they are defined
- Allows for both early, safe trapping and proper expansion of trapped commands with variables defined later
- Live hidden‑item detection (no Finder relaunch required)
- A temporary hidden file is created inside a transient test directory; an AppleScript
count
determines whether Finder is showing it. - The result is exposed through
showsHidden
and affects match string generation - Match terms automatically include or exclude hidden files to mirror the user's current setting
- Why? In current macOS versions, neither
defaults
nor AppleScript can report whether hidden items. - Limitation: Applies to hidden dotfiles (and folders) only (i.e. '.my-item')
- Items hidden with
chflags
aren't supported in the standard UNIX shell, due tofind
's limitation with macOS-specific flags. - It's technically possible to check flags as well, but reading the 'hidden' flag of every item in every directory would add far more overhead.
- Items hidden with
- A temporary hidden file is created inside a transient test directory; an AppleScript
Performance
- Optimized
find
call into separate functions (list_items_nonhidden()
andlist_items_all()
), chosen dynamically based onshowsHidden
flag - Moved certain redundant definitions from the function scope to the main scope
- Replaced multiple processes with
- Single‑shot temp‑dir workflow
- A new
define_dirs()
function centralizes all cache/working directories - A single
/usr/bin/mktemp -d
plus atrap
handles cleanup only once — no more scatteredmkdir
/rm
- A new
while read
loops with process substitution reduce the need for zsh array parsing.
Codebase Improvements
- Executable map updated
- All executables are exported once for no
$PATH
lookups - For helper scripts, all executables are now called directly by their absolute paths
- All executables are exported once for no
- AppleScript now runs immediately after only strictly necessary definitions.
- Smarter
sanitize()
- Replaces the narrow, no‑break space (
U+202F
) before control‑character escaping - Excludes
\x0A
from conditional check before runningperl
- Improves control flow in the dynamic collapsing of
$HOME
to~
- Better handling of Unicode directional formatting characters
- Replaces the narrow, no‑break space (
- Streamlined error handling
- More consistent error checking throughout all scripts
- Better process management for background operations
- Herestring usage
- Many process substitutions that used
print
orecho
have been replaced with herestrings.
- Many process substitutions that used
- More detailed comments added to all scripts
Bug Fixes
- Trash‑path parsing on volumes with spaces is now reliable after a param‑expansion rewrite.
Full Changelog: v1.4.2...v2.0.0
Search Open Finder Windows - Alfred Workflow v1.4.2
Version 1.4.2 - Change Log
Performance
- Defined all executables literally to avoid redundant path lookup in asynchronous loops
- Reduced redundant variable assignments when building window metadata
Misc.
- Enhanced robustness of title/subtitle extraction when dealing with symbolic links
- Fixed rare bug where Trash folders on custom volumes could return invalid POSIX paths
Full Changelog: v1.4.1...v1.4.2
Search Open Finder Windows - Alfred Workflow v1.4.1
Version 1.4.1 - Change Log
New Features
- Trash Detection: Added support for detecting non-empty trash directories across different volume types
- Volume Name Extraction: More accurate volume base path detection and cleaner extraction for mounted drives
Performance
- Replaced
sed
substitution with zsh-native parameter expansion - Rewrote removable drive detection using nested
awk
andgrep
inside process substitution - Optimized trash checking by eliminating unnecessary
grep -v
in favor of directfind
exclusion - Replaced extraction of window info from Finder with faster native zsh string slicing
- Improved caching logic for custom icons by standardizing path processing
Misc.
- Improved matching and title generation for Finder windows representing Trash or Boot Drive
- Ensured consistent collapsing of home paths (
${HOME}
→~
) except when path is exactly${HOME}/
- Fixed edge cases where trailing slashes could incorrectly affect title/subtitle extraction
- Refactored how "Get Info" windows are parsed for better consistency
- Optimized images to reduce workflow size from 54 MB to 3.6 MB
Full Changelog: v1.3.1...v1.4.1
Search Open Finder Windows - Alfred Workflow v1.4.0
Version 1.4.0 - Change Log
New Features
- Extended Matching: For Finder windows, the user can optionally disable matching of directory contents (files/subdirectories) and path components (parent directories)
Performance
- Accelerated construction of match string by using
find
instead ofls
- Switched to zsh's automatic array separation with
IFS
instead ofwhile read -r line
loop - Replaced unnecessary spawning of subshells with process substitution wherever possible
- Replaced as much use of coreutils as possible with zsh's parameter expansion
- Added caching for custom icons
- Implemented short-term caching of results (Avoids regeneration of JSON after a window closes)
- What this does: Results are updated more quickly after closing a window.
Misc.
- Removed window index from match terms (Alfred already has this built-in with hotkeys)
- Added "~" to display titles and match terms for UNIX-style brevity
- Improved AppleScript's handling of window closures
- Simplified formatting of variable names for consistency
Acknowledgements
Big thanks to may-june-july on the Alfred Forum for this version! The optional extended matching feature and the custom icon caching were both recommended by him.
Full Changelog: v1.3.1...v1.4.0
Search Open Finder Windows - Alfred Workflow v1.3.1
Version 1.3.1 - Change Log
- Removed lingering debug statement from script filter
Full Changelog: v1.3.0...v1.3.1
Search Open Finder Windows - Alfred Workflow v1.3.0
Version 1.3.0 - Change Log
Performance
- Moved
osascript
call from subshell to main shell- Eliminates unnecessary
zsh
processes
- Eliminates unnecessary
Stability
- Added handling for nonstandard Finder windows (e.g., "Recents")
- Added handling for edge-case unicode characters in names of windows and folder contents
- Minimal performance impact (
perl
only spawned when needed)
- Minimal performance impact (
- Added handling for carriage returns ("\r") in JSON results
- Relocated custom icon cache from "$HOME" to "/tmp" to reduce clutter
- Cache remains semi-persistent to allow Alfred to display icons in search results
- Automatically cleaned up when user exits workflow without performing an action
Quality of Life
- Prioritized custom icon retrieval in icon-fetching sequence
- Now respects user-assigned custom icons for directories with macOS special icons
- Example: Custom icon for "Downloads" will override the default folder icon
- New icon for "Recents" window
- Skips more macOS resource forks when building match string
Full Changelog: v1.2.3...v1.3.0
Search Open Finder Windows - Alfred Workflow v1.2.3
Version 1.2.3 - Change Log
- Added name of boot drive (i.e. "Macintosh HD") to JSON
match
value
Full Changelog: v1.2.2...v1.2.3