Mac的一般用户怎么改Hosts文件

| No Comments | No TrackBacks

有个同事不是技术人员,但是使用Mac系统。这类用户比较稀少,但是她遇到了一个很严重的问题就是怎么改hosts文件。以前在Windows下的时候用用notepad %systemroot%\system32\drivers\etc\hosts也是可以的。可这Mac下的Finder根本就找不到这个文件。

最后请出了AppleScript这样的神器,写下了下面这一段。

do shell script "/Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts" with administrator privileges
把拷贝到Applications->AppleScript->Script Editor.app里,运行一下,输入密码后会在一个TextEdit.app中打开/etc/hosts文件,修改完毕后保存并退出TextEdit.app,脚本结束。

也可以使用Script Editor.app把上面这句Compile成一个App,比如叫EditHosts,放在Applications目录下。

No TrackBacks

TrackBack URL: http://mt.khsing.net/cgi-bin/mt-tb.cgi/79

Leave a comment

About this Entry

This page contains a single entry by Guixing published on August 5, 2009 9:40 AM.

Week number of year in python was the previous entry in this blog.

libtool15移到了libtool22 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.