In Finder > Select a folder > Right click, we get a popup with an option to create a new folder:
Is there a way to add menu item New Textfile
for adding a new text file?
findermacosshortcut-menu
In Finder > Select a folder > Right click, we get a popup with an option to create a new folder:
Is there a way to add menu item New Textfile
for adding a new text file?
Best Answer
You could assign a shortcut to a script like this:
There is a bug in 10.7 and 10.8 that affects many other scripts and Automator services like this. Finder ignores new windows when getting the
insertion location
andselection
properties. If you open a new Finder window, select some items in it, and runtell app "Finder" to selection
in AppleScript Editor, the result is the items selected in some window behind the frontmost window (or an empty list). One workaround is to move focus to another application and back, but it results in a visual glitch.So neither of these ways of checking if the desktop is selected work reliably:
You could also wrap the script as an Automator service, but there is another bug where the shortcuts for Automator services don't always work until you hover over the services menu from the menu bar. If the input type was set to no input, the service wouldn't show up in context menus. If it was set to folders or files, you'd have to always secondary-click some folder or file.
Related questions:
I didn't vote to close this question, because many of the solutions in the other questions are affected by either of the two bugs mentioned above. We'll likely get even more questions like this, which could then be closed as duplicates of this question.