本来是要解决mac一个很蠢的问题的:无法新建文件。
之前的策略有两种:一是复制粘贴其他的文件过来。另一个是cd到当前目录下然后touch一个文件。这个有点麻烦,首先cd还得拖到终端一个文件才能找对位置。
这次用了Mac自带的automator自己做一个简单的生成新文件的应用,非常简单。
显然既然automator还可以用shell脚本,能低成本实现的东西还是很多的。
STEPS
open automator
select application
select AppleScript on left bar
WRITE1
2
3
4
5
6
7
8on run {input, parameters}
tell application "Finder"
set selection to make new file at (get insertion location)
end tell
return input
end run
save as file.app in somewhere
YOU can use your own icon, just change the picture to icns and drag it to apps/contents/resources to replace the original one. And also copy your picture to the Get Info Menu
customize toolbar
drug your new application to toolbar
DONE
NEXT TIME click the button above to enjoy your design
As you can see, I design another one to sync my scripts, contents:
1 | rsync -avzh /Users/james/Desktop/website/jamesblog /Volumes/New\ Drive/ |