Skip to content

Instantly share code, notes, and snippets.

@joest67
Created May 9, 2014 14:19
Show Gist options
  • Save joest67/b5201027a5b772ab6d35 to your computer and use it in GitHub Desktop.
Save joest67/b5201027a5b772ab6d35 to your computer and use it in GitHub Desktop.
app for creating file on Finder.
--Based on script found at: http://superuser.com/questions/14118/easiest-way-to-create-a-new-text-file-in-a-finder-window-on-osx
tell application "Finder"
--The following line is commented out since it is buggy in Lion.
--set p to insertion location
try
set p to folder of window 1
on error
set p to desktop
end try
set f to make new file at p
if p as alias is desktop as alias then
set selection to f
else
select f
end if
activate
end tell
tell application "System Events" to keystroke return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment