Created
May 9, 2014 14:19
-
-
Save joest67/b5201027a5b772ab6d35 to your computer and use it in GitHub Desktop.
app for creating file on Finder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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