bazz

Service Automator Script for New File in OSX (Mountain Lion)

Jan 27th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try
  2.     tell application "Finder"
  3.         set il to POSIX path of (insertion location as text)
  4.         set ans to text returned of (display dialog "New-File Name: " default answer "")
  5.         if ans is "" then return
  6.         do shell script "touch " & quoted form of (il & ans)
  7.         set f to POSIX file (il & ans) as alias
  8.         if il is POSIX path of (desktop as text) then
  9.             set selection to f
  10.         else
  11.             select f
  12.         end if
  13.     end tell
  14. end try
Advertisement
Add Comment
Please, Sign In to add comment