Mac OS X 환경 설정을 쉘 파일로 저장하는 방법이 있습니까?


17

Mac OS를 다시 설치하거나 새 Mac을 구입할 때마다 마우스, 독 등 거의 모든 옵션을 수동으로 구성해야합니다.

Mac OS 또는 일부 소프트웨어가 시스템 환경 설정 앱으로 설정 한 모든 구성을 쉘 파일로 저장하여 Mathias Bynens의 https://github.com/mathiasbynens/ 와 같은 것을 만드는 방법을 제공하고 싶습니다. dotfiles / blob / master / .macos

답변:


11

시스템 환경 설정은 사용자 또는 시스템에 따라 다양한 위치에 저장되어있는 것으로 보입니다. 이들 중 다수는 /Library/Preferences/또는 $HOME/Library/Preferences/사용자 별 설정에 저장됩니다 . 그러나 각 환경 설정 창에는 고유 한 저장 방법이 있습니다.

다음을 입력하여 어떤 방식으로 저장되어 있는지 확인할 수 있습니다.

defaults read <domain>

<domain>사용자 별 시스템 환경 설정에서 파일 이름의 시작 또는 .plist파일 의 전체 경로는 어디에 있습니까 ? 예를 들면 다음과 같습니다.

defaults read com.apple.screensaver
defaults read /Library/Preferences/com.apple.screensaver

전자는 화면 보호기 설정의 사용자 별 사용자 정의를 보여주고 후자는 시스템 화면 보호기 설정을 보여줍니다.

설정은 크게 기본 설정 창에 의해 구성되지만 반드시 그럴 필요는 없습니다. 당신은 그들과 모든 /Library/Preferences하위 폴더 SystemConfiguration를 찾아야 할 것입니다 (특히 ).

한 가지 옵션은 관련 파일을 복사 한 다음 새로 설치하기 위해 다시 넣는 것입니다.

다른 방법은 필요에 따라 내보내고 가져 오는 것입니다.

전원 관리 (에너지 절약) 시스템 환경 설정을 pm.plist로 내보내기 :

defaults export /Library/Preferences/SystemConfiguration/com.apple.PowerManagement pm.plist

pm.plist새 컴퓨터 에서 해당 환경 설정 가져 오기 :

defaults import /Library/Preferences/SystemConfiguration/com.apple.PowerManagement sysprefs.plist

.plist컴퓨터간에 공유하고 싶지 않거나 특정 시스템 환경 설정이있는 경우 다양한 내 보낸 파일 을 편집 할 수도 있습니다. 이렇게하면 로컬에서 일부 사용자 정의를 수행 할 수 있으며 import명령은이를 덮어 쓰지 않고 .plist파일 에서 설정 한 것을 추가하기 만하면 됩니다. 이 defaults명령을 사용 하여 자신의 .plist파일도 수정할 수 있습니다 (단, 이름뿐만 아니라 파일의 전체 경로를 지정하거나 사용자 별 환경 설정을 수정하고 있는지 확인하십시오).


1
"com.apple.systempreferences"에는 실제로 시스템에 대한 환경 설정이 포함되어 있지 않습니다. 시스템 환경 설정 응용 프로그램의 환경 설정이 포함되어 있습니다. 실제 구성의 없음 그래서 당신이 할 시스템 환경 설정이 파일에 저장됩니다.
Tony Williams

@TonyWilliams, 당신이 바로 그것을 고칠 것입니다 ...
drfrogsplat

9

필요한 모든 변경을 수행하는 스크립트를 자동으로 생성하는 것은 거의 불가능합니다. Mac 시스템 관리자는 어두운 바에서 맥주 나 버번을 마시고이 파일들을 교체하는 데 많은 시간을 소비합니다. 탭을 선택할 준비가되어 있지 않으면 모든 작업을 공유하는 것을 꺼려합니다.

실제로 구성 변경을 캡처하는 가장 쉬운 방법은 스냅 샷을 사용하는 것입니다.

InstallEase 사본을 잡고 새 Mac을 스냅 샷하십시오. 이제 원하는 모든 구성을 수행하고 다른 스냅 샷을 작성하고 변경된 파일을 새 Mac에 설치하는 설치 프로그램을 빌드 할 수 있습니다.

물론 새로운 버전의 운영 체제에 변경 사항을 적용 할 때 합병증이 발생할 수 있지만 이것이 버번을 마시는 이유입니다.


"defaults write"명령에 대한 옵션이있는 목록이 최소한 있습니까?
Enrico P. Varella

아니요. defaults 명령은 시스템의 모든 기본 설정 파일에 쓸 수 있으므로 전체 목록을 제공 할 수 없습니다.
Tony Williams

이것은 영리한 아이디어입니다.
Danijel-James W

1
InstallEase는 더 이상 사용할 수없는 것 같습니다
Sebastian

캐스퍼에는 InstallEase 대신 사용할 수있는 스냅 샷 도구가 있습니다.
Tony Williams

6

마지막으로 완전히 다시 설치하면 전체 ~/Library/Preferences/폴더가 복사되고 폴더 때문에 아무런 문제가 발생하지 않았습니다. 이전 버전의 응용 프로그램 설정 및 Mac 관련 설정은 무시해야합니다. ~/Library/Preferences/새 설치 에는 파일이 거의 없으며의 모든 파일을 삭제 ~/Library/Preferences/하면 환경 설정 파일이 필요할 때 다시 작성됩니다.

샌드 박스 응용 프로그램의 환경 설정 파일이 이제에 저장되어 ~/Library/Containers/있지만 다른 Mac에 복사하면 문제가 발생하는지 모르겠습니다.

Migration Assistant 만 사용할 수도 있습니다 .

또는 .osx경로 를 따라 가면 다음 과 같은 결과를 얻을 수 있습니다 defaults read.

  1. 운영 defaults read|awk 'length<200'>/tmp/a
  2. 일부 설정 변경
  3. 운영 defaults read|awk 'length<200'>/tmp/b;diff /tmp/[ab]

fseventer 를 실행 sudo opensnoop하거나 사용 하여 GUI에서 환경 설정을 변경할 때 어떤 파일이 수정되는지 확인할 수 있습니다.


3

내 문제에 최소한 유용한 것을 찾기 위해 여러 시간을 보낸 후에 Secrets 라는 웹 사이트를 찾았습니다. Secrets 는 많은 일반적인 Mac OS "기본 쓰기"명령을 제공합니다.

어쨌든, 나와 도움이 된 설명과 팁을 주신 Tony와 drfrogsplatless에게 감사드립니다.

(편집 : 보관 된 버전을 사용하여 오프라인 사이트)



1

Mackup은 당신이 찾고있는 것입니다. https://github.com/lra/mackup/tree/master/doc


Mackup은 멋진 도구처럼 보이지만 기본 쓰기는 지원하지 않습니다. 또한 이것은 당신이 제공 한 링크보다 더 잘 설명합니다 : github.com/lra/mackup
ClintM

1

다음은 내가 Mac 용으로 2016 년 8 월에 쓴 부분적으로 완성 된 Apple Script입니다. 여기에 "개념 증명"은 약간 강력하지만, 다음과 같이 사용할 수 있습니다.

(*이 스크립트를 실행하기 전에 먼저 시스템 환경 설정-> 보안 및 개인 정보-> 접근성에서 Apple 스크립트 타이트를 부여하고 Apple 스크립트가 컴퓨터를 제어 할 수 있도록 허용해야합니다. 스크립트가 실패 할 때까지 스크립트를 실행하면 빠르게 시작할 수 있습니다. 그런 다음 스크립트를 중지하고 해당 환경 설정 대화 상자로 이동 한 후 스크립트 편집기 옆에있는 상자를 체크 한 다음 돌아가서 이미 중복 된 스크린 샷을 모두 삭제하고 (중복적인 혼동을 피하기 위해) 스크립트를 다시 시작할 수 있습니다.

왜 이렇게해야합니까? 일단 열리고 "사진"된 일부 기본 설정 대화 상자는 마우스로 취소 단추를 클릭하여 명시 적으로 닫아야합니다. 해당 환경 내에서 "컴퓨터를 제어 할 수있는"권한이 없으면 Apple Script가이를 수행 할 수 없습니다. *)

tell application "System Preferences" to quit
delay 0.25

-- MAKE THE PREFS PICS FOLDER ON THE DESKTOP IF IT ISN'T THERE ALREADY.
-- IF IT IS THERE ALREADY, NO CHECKING IS DONE WITH REFERENCE TO WHATEVER FILES ARE IN IT.
tell application "Finder"
    if not (exists folder "Prefs Pics" of desktop) then
        make new folder with properties {name:"Prefs Pics", location:"desktop"}
    end if
end tell

tell application "System Preferences"
    activate

-- THE PREFS ARE ORDERED BELOW ALPHABETICALLY. TO HAVE THEM SAVE THAT WAY, REMOVE THE ORDER ID (oid) VARIABLE FROM THE CODE LINE SETTING EACH FILENAME. OTHERWISE THE FILENAME WILL BE SET BASED ON THE GROUP AND ICON NUMBERS (ROW AND COLUMN) AS DISPLAYED WHEN SYSTEM PREFS ARE ARRANGED BY CATEGORY.
-- GROUP 4 NO 3 APP STORE
set oid to 43
set current pane to pane "com.apple.preferences.appstore"
-- Now that the first pref window is up, get its name and assign it to a variable
set nid to (get name of first window whose visible is true)
-- Do the same for its ID
set wid to (get id of first window whose visible is true)
-- Now wait one second and capture the window, passing the wid varialble to screencapture's -l switch and the nid variable to the filename to be used, and save the file
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"
-- note you can't be messing around with the computer until the script ends; otherwise you'll interfere and prolly capture wrong winders

-- GROUP 4 NO 7 TIME MACHINE
set oid to 47
set current pane to pane "com.apple.prefs.backup"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 3 NO 5 BLUETOOTH
set oid to 35
set current pane to pane "com.apple.preferences.Bluetooth"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 4 NO 5 DATE & TIME
set oid to 45
set current pane to pane "com.apple.preference.datetime"
reveal anchor "DateTimePref" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "TimeZonePref" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "ClockPref" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 1 NO 2 DESKTOP & SCREEN SAVER                                              -- NEEDS TROUBLESHOOTING TO SELECT LEFT PANE IN DESKTOP TAB
set oid to 12
set current pane to pane "com.apple.preference.desktopscreeneffect"
-- reveal anchor "DesktopPref" of current pane
-- set nid to (get name of first window whose visible is true)
-- set wid to (get id of first window whose visible is true)
-- do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "ScreenSaverPref" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 2 NO 1 DISPLAYS
set oid to 21
set current pane to pane "com.apple.preference.displays"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"
-- reveal anchor "displaysArrangementTab" of current pane                   -- NEEDS TROUBLESHOOTING
-- reveal anchor "displaysColorTab" of current pane                         -- NEEDS TROUBLESHOOTING
-- reveal anchor "displaysGeometryTab" of current pane                      -- NEEDS TROUBLESHOOTING
-- reveal anchor "displaysDisplayTab"                                               -- NEEDS TROUBLESHOOTING

-- GROUP 1 NO 3 DOCK
set oid to 13
set current pane to pane "com.apple.preference.dock"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 2 NO 2 ENERGY SAVER
set oid to 22
set current pane to pane "com.apple.preference.energysaver"
--  reveal anchor "Schedule" of current pane                                        -- NEEDS TO BE CLOSED BEFORE MOVING ON

-- GROUP 1 NO 4 MISSION CONTROL
set oid to 14
set current pane to pane "com.apple.preference.expose"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 3 NO 3 EXTENSIONS
set oid to 33
set current pane to pane "com.apple.preferences.extensions"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 1 NO 1 GENERAL
set oid to 11
set current pane to pane "com.apple.preference.general"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 3 NO 1 ICLOUD  
-- set oid to 31
-- set current pane to pane "com.apple.preferences.icloud"                  -- THIS PREFERENCE WAS NOT COPIED

-- GROUP 3 NO 2 INTERNET ACCOUNTS
-- set oid to 32
-- set current pane to pane "com.apple.preferences.internetaccounts"        -- THIS PREFERENCE WAS NOT COPIED

-- GROUP 2 NO 3 KEYBOARD
set oid to 23
set current pane to pane "com.apple.preference.keyboard" -- NEEDS TROUBLESHOOTING
reveal anchor "keyboardTab" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Text" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "shortcutsTab" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "InputSources" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "keyboardTab_ModifierKeys" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

tell application "System Events" to tell process "System Preferences"
    click button "Cancel" of sheet 1 of window "Keyboard"
end tell

-- GROUP 1 NO 5 LANGUAGE & REGTION
set oid to 15
set current pane to pane "com.apple.Localization"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Region" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Language" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 2 NO 4 MOUSE
set oid to 14
set current pane to pane "com.apple.preference.mouse"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 3 NO 4 NETWORK
--  set oid to 34
--  set current pane to pane "com.apple.preference.network"

-- GROUP 1 NO 8 NOTIFICATIONS
-- set oid to 18
-- set current pane to pane "com.apple.preference.notifications"

-- GROUP 4 NO 2 PARENTAL CONTROLS
-- set oid to 42
--  set current pane to pane "com.apple.preferences.parentalcontrols"

-- GROUP 2 NO 6 PRINTERS & SCANNERS
--  set oid to 26   
--  set current pane to pane "com.apple.preference.printfax"
-- reveal anchor "fax" of current pane
--  reveal anchor "share" of current pane
--  reveal anchor "print" of current pane
-- reveal anchor "scan" of current pane

-- GROUP 1 NO 6 SECURITY & PRIVACY
set oid to 16
set current pane to pane "com.apple.preference.security"
reveal anchor "General" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "FDE" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Firewall" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy_LocationServices" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy_Contacts" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy_Calendars" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy_Reminders" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy_Facebook" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy_Accessibility" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Privacy_Diagnostics" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"
--  reveal anchor "Privacy_Twitter" of current pane
--  reveal anchor "Privacy_Weibo" of current pane
--  reveal anchor "Privacy_TencentWeibo"
--  reveal anchor "Privacy_Assistive" of current pane
--  reveal anchor "Privacy_LinkedIn" of current pane
--  reveal anchor "Advanced" of current pane

-- GROUP 3 NO 6 SHARING
set oid to 36
set current pane to pane "com.apple.preferences.sharing"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 2 NO 7 SOUND
set oid to 27
set current pane to pane "com.apple.preference.sound"
reveal anchor "effects" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "output" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "input" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 4 NO 4 DICTATION & SPEECH
set oid to 44
set current pane to pane "com.apple.preference.speech"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "TTS" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Dictation" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 1 NO 7 SPOTLIGHT
set oid to 17
set current pane to pane "com.apple.preference.spotlight"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "privacy" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "searchResults" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 4 NO 6 STARTUP DISK
set oid to 46
set current pane to pane "com.apple.preference.startupdisk"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 2 NO 5 TRACKPAD
set oid to 25
set current pane to pane "com.apple.preference.trackpad"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 4 NO 1 USERS & GROUPS
set oid to 41
set current pane to pane "com.apple.preferences.users"
reveal anchor "passwordPref" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "startupItemsPref" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "loginOptionsPref" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

--  reveal anchor "mobilityPref" of current pane
--  set nid to (get name of first window whose visible is true)
--  set wid to (get id of first window whose visible is true)
--  do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

-- GROUP 4 NO 8 ACCESSIBILITY
set oid to 48
set current pane to pane "com.apple.preference.universalaccess"
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Seeing_VoiceOver" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Switch" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Keyboard" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Seeing_Display" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Hearing" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Seeing_Zoom" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "SpeakableItems" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Media_Descriptions" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Mouse" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"

reveal anchor "Captioning" of current pane
set nid to (get name of first window whose visible is true)
set wid to (get id of first window whose visible is true)
do shell script "screencapture -T1 -l" & wid & " ~/Desktop/Prefs\\ Pics/" & oid & "\\ " & quoted form of (nid) & "\\ " & "$(date +%Y-%m-%d-%H%M%S).png"
end tell
tell application "System Preferences" to quit


-- HELPERS FOR THE HOMEWORK THAT NEEDED TO BE DONE BEFORE THE SCRIPT COULD BE WROTEN
-- GET ALL PANE ID'S
-- tell application "System Events"
-- tell application "System Preferences"
-- get the id of every pane
-- end tell
-- end tell


-- GET ALL PANE NAMES
-- tell application "System Preferences"
-- name of panes
-- end tell


-- GET THE ANCHOR NAME FOR A PARTICULAR PANE
-- tell application "System Preferences"
-- activate
-- get the name of every anchor of pane id "com.apple.preferences.users"
-- end tell
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.