2015-10-18 34 views
0
tell application "System Events" 
    tell security preferences 
     get properties 
    end tell 
end tell 

腳本編輯器給出錯誤「系統事件出錯:AppleEvent處理程序失敗。」 number -10000爲什麼我在這短小的蘋果上不斷收到錯誤

+1

我的猜測是這是一個錯誤。我確定這個腳本曾經工作過。這是蘋果的一個例子(我相信你知道)。系統事件字典清楚地顯示屬性。您仍然可以獲得其他多個首選項的屬性,但不再是安全首選項。您仍然可以獲取各個屬性,因此可以直接單獨獲取它們以避開該錯誤。 – jweaks

回答

1

因爲secure preferences object中沒有properties屬性。 可用屬性是:

  • automatic login
  • log out when inactive
  • log out when inactive interval
  • require password to unlock
  • require password to wake
  • secure virtual memory(返回一個錯誤,似乎是一個錯誤)

直接讀取屬性

tell application "System Events" 
    tell security preferences 
    get automatic login 
    end tell 
end tell 
相關問題