[TCC.db]TCC.dbを操作してプライバシー設定を変更する(カメラ・マイク・音声認識)
一部修正
SPEECH_RECOGNITION→SpeechRecognition
OS11 OS12専用 OS10.15以下とTTC.DBは互換がありません
選択したアプリケーションを
システム環境設定>>セキュリティとプライバシー>>プライバシー
の
カメラ・マイク・音声認識を有効にする

(************************************************************************
↑この上の▶︎をぽっちっとしてください
TCC.dbに選択したアプリを登録します
登録するのは
カメラ マイク 音声認識です。
20211101 初回作成
************************************************************************)
set theComandText to ("id -un") as text
set theUserName to (do shell script theComandText) as text
tell application "Finder"
set aliasChooseApp to (choose file "test" with prompt "" of type {"APPL"} default location "/Applications" with multiple selections allowed without showing package contents) as list
end tell
set numCntAppList to (count of aliasChooseApp) as number
set numCntApp to 1 as number
repeat numCntAppList times
set theLineAPP to (item numCntApp of aliasChooseApp) as alias
set theFileInfo to info for theLineAPP as list
tell theFileInfo
set theBundleIdentifier to (bundle identifier as list) as text
end tell
try
set theCmdText to ("/usr/bin/tccutil reset Camera " & theBundleIdentifier & "") as text
do shell script theCmdText
delay 0.5
end try
try
set theCmdText to ("/usr/bin/tccutil reset Microphone " & theBundleIdentifier & "") as text
do shell script theCmdText
delay 0.5
end try
try
set theCmdText to ("/usr/bin/tccutil reset SpeechRecognition " & theBundleIdentifier & "") as text
do shell script theCmdText
delay 0.5
end try
try
set theCmdText to ("/usr/bin/sqlite3 /Users/" & theUserName & "/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceCamera','" & theBundleIdentifier & "',0,2,2,1, NULL,NULL,NULL,'UNUSED',NULL,0,1606059851);\"") as text
do shell script theCmdText
delay 0.5
end try
try
set theCmdText to ("/usr/bin/sqlite3 /Users/" & theUserName & "/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceMicrophone','" & theBundleIdentifier & "',0,2,2,1, NULL,NULL,NULL,'UNUSED',NULL,0,1606059851);\"") as text
do shell script theCmdText
delay 0.5
end try
try
set theCmdText to ("/usr/bin/sqlite3 /Users/" & theUserName & "/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceSpeechRecognition','" & theBundleIdentifier & "',0,2,2,1, NULL,NULL,NULL,'UNUSED',NULL,0,1606059851);\"") as text
do shell script theCmdText
delay 0.5
end try
set numCntApp to numCntApp + 1 as number
end repeat
set theCmdText to ("open \"x-apple.systempreferences:com.apple.preference.security?Privacy_SpeechRecognition\"") as text
do shell script theCmdText
| 固定リンク
「TCC.db」カテゴリの記事
- [TCC.db] ローカルドメインのtcc.dbを操作する(2021.11.01)
- [TCC.db]zoomインストールとTCC.db操作のサンプル(2021.11.01)
- [TCC.db]TCC.dbを操作してプライバシー設定を変更する(カメラ・マイク・音声認識)(2021.11.01)
- [OS12]PrivacyTCCServices(2021.10.31)
- [OS12]PrivacyTCCServices(2021.10.31)