Per Møldrup-Dalum

FileOpen, and the beginning of a tool chest for automation

OMG! Why didn't I think of this before: a simple CLI tool to open files when I almost know the filename? Just a small hackable and customizable Spotlight for the command line.

This tool also marks the beginning of a tool chest for automation and quick scripting. I've always built such tools, but LLMs have accelerated this, and make everything much more accessible, from coding, over git, makefiles, to documentations. I'm still the boss, but I have several quite capable assistants – and they are much better than me in remembering libraries, function calls, parameters, etc. ...

The tool is written for me with a focus on what I need. If you can use it, enjoy!

Code

The code is written in Python [add link to article about what I use for programming] and can be found and downloaded from GitHub at Mac Tool Chest.

Usage

The tool takes two options: -t (type) and -h (help). If no type is specified, the tool will search for files and folders.

        >: FileOpen
        usage: FileOpen [-h] [-t {file,folder}] filename
        FileOpen: error: the following arguments are required: filename
            

The -t limits the search to either filenames or folder names.

This is what it looks like when multiple matches are found:

        >: FileOpen wierd-file-name
        Found 3 matches:
        (1) /Users/au15929/test-bed/wierd-file-name.txt
        (2) /Users/au15929/test-bed/wierd-file-name-2.txt
        (3) /Users/au15929/test-bed/wierd-file-name-3456.txt
        Enter number to open (or q to quit):
            

Ideas for future work