dahyukchoi

Util86X Script / Release 3

Jun 27th, 2020 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.54 KB | None | 0 0
  1. https://x86.co.kr/macnews/4918009
  2. ___________________________________
  3.  
  4. Changelog
  5.  
  6. V1 - Added 7 Utilities
  7. Edited DarkChanger Script
  8. Thanks for Ael, Mactopia and All of X86 Users
  9.  
  10. V2 - Translated to Korean
  11. Added 1 Utility
  12.  
  13. V3 - Added 2 Utilities
  14. Thanks for All of X86 Users!!!
  15.  
  16.  
  17. set itemlist to {"모든 앱 종료 by Ael", "잠자기 비/활성화 토글 by Ael", "잠자기 상태 확인 by dahyukchoi", "사운드 관련 문제 해결 by dahyukchoi", "시동음 비/활성화 토글 by dahyukchoi", "Dock 강제 종료 by dahyukchoi", "Dock 아예 숨기기 by dahyukchoi", "다운로드 기록 삭제 (시스템내) by dahyukchoi", "숨겨진 파일/폴더 비/활성화 by dahyukchoi", "도움말", "크레딧"}
  18. set thetext to "X86 유틸리티 ALL-IN-ONE (Util86X)
  19. 7가지의 추가 기능"
  20.  
  21.  
  22. display dialog thetext buttons {"종료", "추가 기능", "다크모드 체인저"} default button {"추가 기능"} cancel button {"종료"} with icon note with title "X86 ALL-IN-ONE (Util86X)"
  23.  
  24. if button returned of result = "다크모드 체인저" then
  25. tell application "System Events"
  26. if dark mode of appearance preferences is false then
  27. tell appearance preferences
  28.  
  29. set dark mode to true
  30.  
  31. end tell
  32. display notification "Dark Mode로 변경되었습니다." with title "Util86X" sound name "submarine"
  33. else
  34. tell appearance preferences
  35.  
  36. set dark mode to false
  37.  
  38. end tell
  39. display notification "Light Mode로 변경되었습니다." with title "Util86X" sound name "submarine"
  40. end if
  41. end tell
  42.  
  43.  
  44. else if button returned of result = "추가 기능" then
  45. set itemname to choose from list itemlist with prompt "메뉴를 선택해주세요." default items {"Quit All Apps"}
  46.  
  47. if itemname contains "모든 앱 종료 by Ael" then
  48. --by Ael --Thanks Ael
  49. display dialog "모든 어플리케이션을 종료합니다." buttons {"닫기", "종료"} default button {"종료"}
  50. if button returned of result = "종료" then
  51. do shell script "cd `getconf DARWIN_USER_DIR`"
  52. tell application "System Events"
  53. set theVisibleApps to (name of application processes where visible is true)
  54. end tell
  55. repeat with thisApp in theVisibleApps
  56. try
  57. tell application thisApp
  58. try
  59. quit every document
  60. quit every window
  61. on error
  62. killall
  63. end try
  64. end tell
  65. end try
  66. end repeat
  67. end if
  68. end if
  69.  
  70. if itemname contains "잠자기 비/활성화 토글 by Ael" then
  71. set the_script to "pmset -g"
  72. set the_result to do shell script the_script
  73. if contents of the_result does not contain "SleepDisabled" then
  74. do shell script "sudo pmset -a disablesleep 0" with administrator privileges
  75. display dialog "컴퓨터를 재부팅해주세요." buttons {"닫기"} cancel button {"닫기"}
  76. else if contents of the_result contains "SleepDisabled 1" then
  77. display dialog "잠자기가 비활성화 상태입니다." buttons {"닫기", "활성화"} default button {"활성화"} cancel button {"닫기"} with title "Sleep Toggle"
  78. if button returned of result = "활성화" then
  79. do shell script "sudo pmset -a disablesleep 0; sudo pmset -a sleep 1" with administrator privileges
  80. display notification "잠자기가 활성화 되었습니다." with title "Sleep Toggle" sound name "submarine"
  81. end if
  82. else if contents of the result contains "SleepDisabled 0" then
  83. display dialog "잠자기가 활성화 상태입니다." buttons {"닫기", "비활성화"} default button {"비활성화"} cancel button {"닫기"} with title "Sleep Toggle"
  84. if button returned of result = "비활성화" then
  85. do shell script "sudo pmset -a disablesleep 1; sudo pmset -a sleep 0" with administrator privileges
  86. tell application "System Events" to activate
  87. display notification "잠자기가 비활성화 되었습니다." with title "Sleep Toggle" sound name "submarine"
  88.  
  89. end if
  90. end if
  91. end if
  92.  
  93. if itemname contains "잠자기 상태 확인 by dahyukchoi" then
  94. set the_script to "pmset -g"
  95. set the_result to do shell script the_script
  96. if contents of the_result does not contain "SleepDisabled" then
  97. display dialog "잠자기 설정이 보이지 않습니다. 터미널에서 sudo pmset -a disablesleep 0을 실행해주세요." buttons {"닫기"} cancel button {"닫기"} with title "Check SleepDisabled"
  98. else if contents of the_result contains "SleepDisabled 1" then
  99. display dialog "잠자기가 비활성화 상태입니다." buttons {"닫기"} cancel button {"닫기"} with title "Check SleepDisabled"
  100. else if contents of the result contains "SleepDisabled 0" then
  101. display dialog "잠자기가 활성화 상태입니다." buttons {"닫기"} cancel button {"닫기"} with title "Check SleepDisabled"
  102.  
  103. end if
  104. end if
  105.  
  106. if itemname contains "사운드 관련 문제 해결 by dahyukchoi" then
  107. set theDialogText to "현재 시간은 " & (current date) & "입니다.
  108. 이 앱을 이용해주셔서 감사합니다. Coreaudiod를 종료하시겠습니까?"
  109.  
  110. display dialog theDialogText buttons {"닫기", "종료", "제작자"} default button {"종료"} cancel button {"닫기"}
  111. if button returned of result = "종료" then
  112. do shell script "sudo pkill coreaudiod" with administrator privileges
  113. display notification "Coreaudiod를 종료했습니다." with title "PKILL COREAUDIOD" sound name "submarine"
  114. else if button returned of result = "제작자" then
  115. display dialog "Made By X86 USER" with title "PKILL COREAUDIOD"
  116. end if
  117. end if
  118.  
  119. if itemname contains "시동음 비/활성화 토글 by dahyukchoi" then
  120. display dialog "시동음 비/활성화 토글 by dahyukchoi" buttons {"닫기", "토글", "초기 설정"} default button {"토글"} cancel button {"닫기"} with title "Boot Sound Control"
  121. if button returned of result = "초기 설정" then
  122. do shell script "sudo nvram StartupMute=%00" with administrator privileges
  123. display dialog "앱를 재실행해주세요." buttons {"닫기"} cancel button {"닫기"}
  124. else if button returned of result = "토글" then
  125. set the_script to "nvram StartupMute"
  126. set the_result to do shell script the_script
  127. if contents of the_result contains "StartupMute %01" then
  128. display dialog "시동음이 비활성화 상태입니다." buttons {"닫기", "활성화"} default button {"활성화"} cancel button {"닫기"} with title "Boot Sound Control"
  129. if button returned of result = "활성화" then
  130. do shell script "sudo nvram StartupMute=%00" with administrator privileges
  131. display notification "시동음이 활성화 되었습니다." with title "Boot Sound Control" sound name "submarine"
  132. end if
  133. else if contents of the_result contains "StartupMute %00" then
  134. display dialog "시동음이 활성화 상태입니다." buttons {"닫기", "비활성화"} default button {"비활성화"} cancel button {"닫기"} with title "Boot Sound Control"
  135. if button returned of result = "비활성화" then
  136. do shell script "sudo nvram StartupMute=%01" with administrator privileges
  137. display notification "시동음이 비활성화 되었습니다." with title "Boot Sound Control" sound name "submarine"
  138.  
  139. end if
  140. end if
  141. end if
  142.  
  143.  
  144.  
  145. else if itemname contains "Dock 강제 종료 by dahyukchoi" then
  146. display dialog "Dock을 강제 종료하시겠습니까?" buttons {"닫기", "종료"} cancel button {"닫기"} with title "Util86X"
  147. if button returned of result = "종료" then
  148. set the_script to "killall Dock"
  149. do shell script the_script
  150. display notification "Dock이 강제 종료되었습니다." with title "Util86X" sound name "submarine"
  151.  
  152. end if
  153.  
  154. else if itemname contains "Dock 아예 숨기기 by dahyukchoi" then
  155. display dialog "Dock을 아예 숨기시겠습니까?" buttons {"닫기", "숨기기", "복원"} cancel button {"닫기"} with title "Util86X"
  156. if button returned of result = "숨기기" then
  157. set the_script to "defaults write com.apple.dock autohide -bool true && killall Dock"
  158. set the_scr to "defaults write com.apple.dock autohide-delay -float 1000 && killall Dock"
  159. set the_scrp to "defaults write com.apple.dock no-bouncing -bool TRUE && killall Dock"
  160. do shell script the_script
  161. do shell script the_scr
  162. do shell script the_scrp
  163. display notification "Dock이 숨겨졌습니다." with title "Util86X" sound name "submarine"
  164.  
  165.  
  166.  
  167. else if button returned of result = "복원" then
  168. set the_script to "defaults write com.apple.dock autohide -bool false && killall Dock"
  169. set the_scr to "defaults write com.apple.dock autohide-delay -float 0.1 && killall Dock"
  170. set the_scrp to "defaults write com.apple.dock no-bouncing -bool FALSE && killall Dock"
  171. do shell script the_script
  172. do shell script the_scr
  173. do shell script the_scrp
  174. display notification "복원되었습니다." with title "Util86X" sound name "submarine"
  175.  
  176. end if
  177. end if
  178.  
  179. if itemname contains "다운로드 기록 삭제 (시스템내) by dahyukchoi" then
  180. display dialog "다운로드 기록을 삭제하시겠습니까?" buttons {"닫기", "삭제"} cancel button {"닫기"} with title "Util86X"
  181. if button returned of result = "삭제" then
  182. set the_script to "sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
  183. do shell script the_script
  184. display notification "다운로드 기록이 삭제되었습니다." with title "Util86X" sound name "submarine"
  185.  
  186. end if
  187. end if
  188.  
  189. if itemname contains "숨겨진 파일/폴더 비/활성화 by dahyukchoi" then
  190. set the_script to "defaults read com.apple.finder AppleShowAllFiles"
  191. set the_result to do shell script the_script
  192. if contents of the_result contains "FALSE" then
  193. display dialog "숨겨진 파일/폴더를 보시겠습니까?" buttons {"닫기", "활성화"} cancel button {"닫기"} with title "Util86X"
  194. if button returned of result = "활성화" then
  195. set the_script to "defaults write com.apple.finder AppleShowAllFiles TRUE"
  196. do shell script the_script
  197. display notification "활성화되었습니다." with title "Util86X" sound name "submarine"
  198.  
  199. end if
  200.  
  201. else if contents of the_result contains "TRUE" then
  202. display dialog "숨겨진 파일/폴더를 안보시겠습니까?" buttons {"닫기", "비활성화"} cancel button {"닫기"} with title "Util86X"
  203. if button returned of result = "비활성화" then
  204. set the_script to "defaults write com.apple.finder AppleShowAllFiles FALSE"
  205. do shell script the_script
  206. display notification "비활성화되었습니다." with title "Util86X" sound name "submarine"
  207.  
  208. end if
  209. end if
  210. end if
  211.  
  212. if itemname contains "크레딧" then
  213. display dialog "X86 유저분들 감사합니다!!!!
  214. Special Thanks: Mactopia, Ael" buttons {"닫기"} cancel button {"닫기"} with title "X86 ALL-IN-ONE (Util86X)" with icon note
  215.  
  216. end if
  217.  
  218.  
  219. if itemname contains "도움말" then
  220. display dialog "이 앱은 X86에 올라온 유틸리티들을 모아논
  221. 앱입니다. DarkChanger는 X86에 올라온 toggle dark mode와 Dark86을 기반으로 하여 만들어졌습니다. Sleep Toggle은 Ael님의 Sleep Toggle을 기반으로 하였습니다. 이외에 Check SleepDisabled,
  222. PKILL COREAUDIOD, Boot Sound Control, Kill Dock, Hide Dock은 제작자 본인이 만든 앱을 기반으로 하여 만들어졌습니다. 이 외에 추가할수 있는 유틸리티는 추가하려 노력하고 있습니다. 이 앱을 사용해주셔서
  223. 감사합니다!" buttons {"닫기"} cancel button {"닫기"} with icon note with title "도움말"
  224.  
  225.  
  226. end if
  227. end if
Add Comment
Please, Sign In to add comment