forklift

    Easily copy file contents with ForkLift

    I use the ForkLift 3 file manager on my Mac. Part of my job involves copying-and-pasting the contents of various files into web forms. I made a trivial little shell script so ForkLift can help me:

    #!/bin/sh
    
    if [ ${#@} -ne 1 ]; then
        echo "Expected exactly 1 filename."
        exit -1
    fi   
    
    pbcopy < $1
    

    Then I created a new “Tool” called “Contents to Clipboard” that calls the script with the name of the selected file.

    /Users/me/bin/copy_contents.sh $SOURCE_SELECTION_PATHS
    

    Now I can select a file, select the Commands > Contents to Clipboard menu, and voila! The file’s contents are ready to be pasted into another app.