天天看点

Mac OSX 创建私密文件夹(文件夹单独加密)

Mac OSX 创建私密文件夹(文件夹单独加密)

​​Mac OSX​​

​, by AppleCN.

Mac 平台下最好的做法就是设置文件夹访问权限,打开终端,给文件夹设置访问权限 sudo chmod 700 文件夹,然后其他用户就访问不了。

关于unix权限的资料网上很多,这里我给大家介绍如何通过applescript给文件夹设置保护。

在文件夹上右键,设置文件夹操作脚本,修改open操作,复制下面代码替换原来的提示注视。

​​

on opening folder this_folder

tell application “Finder”

set dialogresult to display dialog “输入密码我瞧瞧也!:” buttons {“确认”} default button 1 default answer ” ”

set PWText to the text returned of dialogresult

if not PWText = “你的密码” then

close folder this_folder

beep 3

display dialog “不能让你看了。。” buttons {“关闭!”}

end if

end tell

end opening folder

打开文件夹的时候就会要求输入密码,错误则无法继续访问