~/Library/Logs/DiagnosticReports의 각 사용자 프로필에서 크래시 로그를 보려면 applescript를 만들려고합니다. * .crash .spin .hang 파일이있을 수 있으므로 * 끝에 *를 사용합니다. 현재 바탕 화면에 "Test"라는 폴더에 모두 복사하되 알맞지 않은 방법인지 확인하십시오.파일이 applescript가있는 다른 프로필에있는 경우 어떻게보고 복사합니까?
내가 노력하고 내가
오류 TEST.TXT \ "\를 만들 수 없습니다"얻을 실행 "타입의 정수로." "TEST.TXT"에서 숫자 -1700 모든 도와
try
do shell script "ls /users >$HOME/Desktop/Users.txt"
do shell script "mkdir ~/Desktop/Test"
end try
set b to boot volume of (system info)
set u to b & "Users"
set theFiles to paragraphs of "Test.txt"
repeat theFiles times
duplicate file u & theFiles & "~/Library/Logs/DiagnosticReports/Xxxxx*" to "~/Desktop/Test"
end repeat
감사를 정수로.
do shell script "mkdir -p ~/Desktop/Test
cp /Users/*/Library/Logs/DiagnosticReports/* ~/Desktop/Test" with administrator privileges
또는 루프 folders of (path to users folder)
을 통해 :
고마워요.하지만 두 스크립트 모두 현재 사용자의 로그 만받는 것처럼 보입니다. 테스트를 위해 다른 사용자에게 충돌 로그를 저장하고 복사하지 않았습니다. – Breathable
루트 권한이 필요한 경우 관리자 권한으로 추가하거나 Finder를 루트로 실행하십시오. – user495470
죄송하지만 어떻게 설정 하시겠습니까? – Breathable