Create a new (.txt) File in Finder - Keyboard Shortcut I wanted to know if there is way to set keyboard shortcuts to make new files in Finder. For example, by default, you can create a new folder using CMD+Shift+N. Is there a keyboard shortcut to create a new text file? I'm a programmer so this would be extremely useful

I would also be interested in creating other file type using keyboard shortcuts. 

I have attempted to use automator but I'm finding it quite confusing and I'm not sure how I would connect a keyboard shortcut to it.
Well, here you go with an AppleScript for that.

First, create the AppleScript:


Open Automator
Create a Quick Action
Set the input to no input
Drag and Drop the Run AppleScript workflow element onto the grey space.
Paste the code from below into the AppleScript
Save the workflow as Create new file
If you have iCloud Drive activated, make sure you are saving the file under Library/Services/ in your Home Folder.




try
  tell application "Finder" to set the this_folder ¬
   to (folder of the front window) as alias
on error -- no open folder windows
  set the this_folder to path to desktop folder as alias
end try

set thefilename to text returned of (display dialog ¬
 "Create file named:" default answer "filename.txt")
set thefullpath to POSIX path of this_folder &amp; thefilename
do shell script "touch \"" &amp; thefullpath &amp; "\""




To add it as a shortcut:


Go to System Preferences -> Keyboard -> Shortcuts -> Services
Scroll down until you find the Service Create new file
Assign a shortcut to it by clicking on the right side none, which turns into a Add Shortcut.
Click the Button and type the shortcut you wish to use.
I use ⌘ Command+⌥ Option+N