MacOSXの自動画面ロック

このコミュニティを単なる必殺の非登録読者として読んで、この記事に出会いました。 このトピックでは、最小限のユーザー参加で画面をロックするための多くのオプションが提案されましたが、私の意見では、それらはすべて「やや重い」です。 それぞれの方法で、何かを押す、どこかをクリックする、そしてご存知のように怠が世界を征服する必要がありました(良い方法で)。



だから、私はあなたの視線にすべてを自動化する方法の1つを紹介したいと思います。

何から準備していますか:

1)スクリプトの通常の使用にはXcodeパッケージをインストールする必要があります

2) BluePhoneEliteプログラム。 多数の組み込みトリガー(iTunes、DVD、iChatステータスの変更など)があります。

3)Bluetoothを搭載した携帯電話(誰もが持っていることを望みますか?:))どこでもマウスをクリックしないようにします。

4)キーチェーン;)







調理方法:

1)単純なものから始めましょう-コンピューターにBluePhoneEliteをインストールします。 プログラムは有料ですが、お金の価値があります(IMHO)。 プログラムの配置方法と電話との「ペアリング」については、誰も質問をしないと思います。

2)プログラム-ユーティリティ-キーチェーンを開き、ユーザー名とパスワードでBluePhoneという名前のオブジェクトを作成します。 (パスワードを自動的に入力する必要があります)

3)システム-セキュリティ設定を開き、「スリープモードとスクリーンセーバーを終了するときにパスワードを要求する」を入力します。

4)AppleScriptを開くと、ここからすべての楽しみが始まります:)。 次のスクリプトをそこにコピーします。

using terms from application "BluePhoneElite 2"

on proximity change phone with event theEvent



if theEvent is "exited" then

set the target_app to ((path to "dlib" from system domain as string) & ¬

"Frameworks:ScreenSaver.framework:Versions:A:Resources:ScreenSaverEngine.app") as alias



set process_flag to false

tell application "System Events"

if exists process "ScreenSaverEngine" then set process_flag to true

if (application processes whose name is "SecurityAgent") is not {} then

if windows of process "SecurityAgent" is not {} then set the process_flag to true

end if

end tell



if process_flag is false then tell application (target_app as string) to launch

end if



if theEvent is "entered" then



set the process_flag to false

tell application "System Events"

if exists process "ScreenSaverEngine" then

set the process_flag to true

tell application "System Events" to keystroke return

else

if (application processes whose name is "SecurityAgent") is not {} then

if windows of process "SecurityAgent" is not {} then set the process_flag to true

end if

end if

end tell



if the process_flag is false then return



set now to current date

repeat

tell application "System Events"

if (application processes whose name is "SecurityAgent") is not {} then

if (windows of process "SecurityAgent") is not {} then



tell application "Keychain Scripting"

set MP to password of key 1 of keychain ¬

"login.keychain" whose name is "BluePhone"

end tell



tell window 1 of application process "SecurityAgent"

keystroke MP

click button "OK" of group 2

end tell



return

end if

end if

end tell

if ((current date) - now) is greater than 20 then exit repeat

delay 0.2

end repeat

end if



end proximity change

end using terms from






ユーザーフォルダーに保存します(オプション)。



5)反応トリガー「Enter / Exit Range」Applescriptを割り当て、スクリプトでファイルを指定します。

6)[設定-ユニバーサルアクセス]に移動し、[支援デバイスのアクセスを有効にする]ボックスをオンにします。



できた!



電話でコンピューターから離れると、スクリーンセーバーがオンになり、映画、音楽などが停止し、コンピューターの近くに表示されるとすぐにスクリプトが自動的にパスワードを入力し、画面が笑顔になります:)

この投稿が画面をロックするときのこの不便を解決するのに役立つことを願っています。



PS:強く蹴っていない-私の最初のレコード。 :)



All Articles