There are a few things I always do when starting a project: make a NotesAndIdeas.txt and a Readme.md file. But opening a blank text file and saving it to the right location is a pain. To the rescue: a Finder keyboard shortcut.
1. WRITE A LITTLE SCRIPT
We’ll use an AppleScript to create the files. This requires two parts: getting the current directory and creating the file using a bash script. In the notes file, I’m adding a header to the top of the file, but you could add any text you want. Newlines must be escaped with two backslash characters:
\\n .
1 2 3 4 5 6 7 8 |
tell application "Finder" select the front Finder window set targetFolder to insertion location as alias set folderPath to POSIX path of targetFolder end tell set makeNoteFile to "echo '\\nNOTES && IDEAS:\\n' >> " & quoted form of folderPath & "/NotesAndIdeas.txt" do shell script makeNoteFile |
I save my scripts to a folder called Hacks to I can tweak them later, if necessary.
Continue reading “Tutorial: Create A Readme-File Finder Shortcut”