*적용중인 도장
https://x86.co.kr/macnews/3505782
Ael님의 스크립트를 수정하여 앱을 수정해보았습니다.
장점이 있다면 터미널이 안보이는 점입니다.
do shell script를 사용해 Terminal이 실행되지 않게끔 수정했습니다.
정상적으로 작동합니다.
타이틀도 추가하였습니다.
스크립트는 마음껏 사용하세요.
--by Ael
set the_script to "pmset -g"
set the_result to do shell script the_script
if contents of the_result does not contain "SleepDisabled" then
do shell script "sudo pmset -a disablesleep 0" with administrator privileges
else if contents of the_result contains "SleepDisabled 1" then
display dialog "잠자기가 비활성화 상태입니다." buttons {"닫기", "활성화"} default button {"활성화"} with title "Sleep Toggle"
if button returned of result = "활성화" then
do shell script "sudo pmset -a disablesleep 0" with administrator privileges
display notification "잠자기가 활성화 되었습니다." with title "Sleep Toggle" sound name "submarine"
end if
else if contents of the result contains "SleepDisabled 0" then
display dialog "잠자기가 활성화 상태입니다." buttons {"닫기", "비활성화"} default button {"비활성화"} with title "Sleep Toggle"
if button returned of result = "비활성화" then
do shell script "sudo pmset -a disablesleep 1" with administrator privileges
tell application "System Events" to activate
display notification "잠자기가 비활성화 되었습니다" with title "Sleep Toggle" sound name "submarine"
end if
end if
P.S. 잠자기가 활성화 되어있는지 안되어있는지 확인해주는 앱을 만들었습니다.
set the_script to "pmset -g"
set the_result to do shell script the_script
if contents of the_result does not contain "SleepDisabled" then
display dialog "잠자기 설정이 보이지 않습니다. 터미널에서 sudo pmset -a disablesleep 0을 실행해주세요." buttons {"닫기"} cancel button {"닫기"} with title "Check SleepDisabled"
else if contents of the_result contains "SleepDisabled 1" then
display dialog "잠자기가 비활성화 상태입니다." buttons {"닫기"} cancel button {"닫기"} with title "Check SleepDisabled"
else if contents of the result contains "SleepDisabled 0" then
display dialog "잠자기가 활성화 상태입니다." buttons {"닫기"} cancel button {"닫기"} with title "Check SleepDisabled"
end if
감사합니다.
제목 | 조회 수 | 날짜 | 글쓴이 |
---|---|---|---|
Apple macOS UniversalMac_Sequoia 15.2 beta2(24C5057p) 24/10/2... | 55 | 24.10.2413:18 | 제로섬 |
Apple Release Candidates 소식 24/10/21일자 | 312 | 24.10.2204:03 | 제로섬 |
Apple public update Releases 소식 (10/04일자) | 475 | 24.10.0409:21 | 제로섬 |
비 지원 맥용 OpenCore-Legacy-Patcher 2.0.2 다운로드(24/09/29... +6 | 2.7만 | 23.06.0413:37 | 제로섬 |
Safari_18.1_for_macOS_Sonoma(619B22)&Ventura_beta_4(619B2... +2 | 355 | 24.09.2014:03 | 제로섬 |
windows & macOS / Install macOS Sequoia beta7 15.1_24B50... | 355 | 24.09.2005:24 | 제로섬 |
세퀘이아 15.0.1 정식(24A348) 전체 프로그램(24/10/04일자) up +4 | 575 | 24.09.1704:38 | 제로섬 |
windows & macOS / Install macOS Sequoia 정식 15.0.1_24A34... | 1013 | 24.07.1806:01 | 제로섬 |
Apple macOS UniversalMac_15.0.1 정식 (24A348)복원IPSW (24/10/... +3 | 494 | 24.09.1020:58 | 제로섬 |
macOS Sonoma 14.7.1 RC3 (23H221) 전체 프로그램 다운로드(24/10... +2 | 720 | 24.08.3015:43 | 제로섬 |
macOS Ventura 13.7.1 RC3 (22H220) 전체 프로그램 다운로드(24/1... | 514 | 24.08.3016:24 | 제로섬 |
windows & macOS / Install macOS Sonoma RC3 14.7.1_23H221... +1 | 5245 | 23.10.1211:27 | 제로섬 |
windows & macOS / Install macOS Ventura RC3 13.7.1_22H220... +1 | 8110 | 23.10.1213:08 | 제로섬 |
Apple M1/M2/M3 macOS Sequoia 15.1 RC (24B82)복원IPSW (24/10/2... | 430 | 24.08.1320:14 | 제로섬 |
Apple Public Releases for 소식 24/08/07일자 | 464 | 24.08.0809:53 | 제로섬 |
macOS Sonoma 14.6.1 정식 (23G93) 전체 프로그램 다운로드(24/08... +4 | 1093 | 24.07.3018:28 | 제로섬 |
macOS Ventura 13.6.9 정식 (22G830) 전체 프로그램 다운로드(24/... | 549 | 24.07.3018:21 | 제로섬 |
macOS Monterey 12.7.6 정식 (21H1320) 전체 프로그램 다운로드 (... +2 | 555 | 24.07.3018:04 | 제로섬 |
Apple Public Releases for 소식 24/07/29일자 +3 | 387 | 24.07.3014:14 | 제로섬 |
Apple, macOS 15 Sequoia 공개 정보 +2 | 3306 | 24.07.0716:59 | 제로섬 |
Safari_18.0.1_정식 설치프로그램_macOS_Sonoma(619A64a)&Ven... +1 | 2720 | 24.07.0619:09 | 제로섬 |
Apple M1/M2/M3 macOS Sonoma 14.6.1 정식 (23G93)복원IPSW (24/0... | 2600 | 24.06.1811:51 | 제로섬 |
Safari_17.6_for_Ventura&Monterey 정식 설치 프로그램 24/07... +1 | 4059 | 24.04.0717:28 | 제로섬 |
windows & macOS / Install macOS Sonoma 정식 14.6.1_22G93.... +1 | 4002 | 24.04.0520:26 | 제로섬 |
windows & macOS / Install macOS Ventura 정식 13.6.9_22G83... | 3782 | 24.04.0521:40 | 제로섬 |
windows & macOS / Install macOS Monterey 정식 12.7.6_21H1... | 3821 | 24.04.0522:27 | 제로섬 |
윈도우 11 23H2 ISO 다운로드 가능 +2 | 1.6만 | 23.11.0423:27 | Mactopia |
Windows에서 macOS 부팅 가능한 USB를 만드는 방법 +16 | 1.9만 | 23.10.0711:52 | 제로섬 |
windows & macOS / Install macOS Big Sur 11.7.10_20G1427.d... | 2.2만 | 23.07.2512:50 | 제로섬 |
여친 없는 엑팔인들을 위한 스팀 게임 몇 가지 나눔 합니다. +27 | 6.7만 | 23.03.0220:10 | 잠퉁이 |
최신 Windows 다운로드 +12 | 4.6만 | 21.10.1703:35 | Dokdo |
윈도우 필수 유틸 #1 - Hoax Eliminator 구라 제거기 +4 | 4.5만 | 21.08.1017:08 | Mactopia |
우분투 서버 설치하기 +3 | 3.5만 | 21.06.0404:29 | 매킨어렵 |
40 | 24.10.2404:44 | 잠퉁이 | |
40 | 24.10.2401:11 | 잠퉁이 | |
39 | 24.10.2401:09 | 잠퉁이 | |
21 | 24.10.2400:59 | 잠퉁이 | |
55 | 24.10.2413:18 | 제로섬 | |
47 | 24.10.2301:14 | 잠퉁이 | |
86 | 24.10.2300:56 | 잠퉁이 | |
55 | 24.10.2300:53 | 잠퉁이 | |
75 | 24.10.2203:47 | 잠퉁이 | |
70 | 24.10.2203:42 | 잠퉁이 | |
312 | 24.10.2204:03 | 제로섬 | |
71 | 24.10.2102:59 | 잠퉁이 | |
51 | 24.10.2102:57 | 잠퉁이 | |
63 | 24.10.2023:18 | 잠퉁이 | |
94 | 24.10.2000:56 | 잠퉁이 | |
90 | 24.10.2000:52 | 잠퉁이 | |
55 | 24.10.1900:55 | 잠퉁이 | |
170 | 24.10.1902:01 | 잠퉁이 | |
52 | 24.10.1901:58 | 잠퉁이 | |
52 | 24.10.1900:36 | 잠퉁이 | |
59 | 24.10.1900:30 | 잠퉁이 | |
71 | 24.10.1900:27 | 잠퉁이 | |
66 | 24.10.1802:23 | 잠퉁이 | |
82 | 24.10.1802:20 | 잠퉁이 | |
52 | 24.10.1802:17 | 잠퉁이 | |
94 | 24.10.1802:15 | 잠퉁이 | |
108 | 24.10.1800:04 | 잠퉁이 | |
75 | 24.10.1800:00 | 잠퉁이 | |
66 | 24.10.1701:42 | 잠퉁이 | |
58 | 24.10.1701:40 | 잠퉁이 | |
77 | 24.10.1701:37 | 잠퉁이 | |
79 | 24.10.1701:35 | 잠퉁이 | |
79 | 24.10.1608:47 | 잠퉁이 | |
208 | 24.10.1612:14 | 제로섬 | |
69 | 24.10.1600:07 | Dokdo | |
108 | 24.10.1501:02 | 잠퉁이 | |
74 | 24.10.1402:49 | 잠퉁이 | |
78 | 24.10.1402:46 | 잠퉁이 | |
80 | 24.10.1402:42 | 잠퉁이 | |
88 | 24.10.1302:48 | 잠퉁이 | |
105 | 24.10.1302:05 | 잠퉁이 | |
68 | 24.10.1212:19 | Nelson | |
133 | 24.10.1201:46 | 잠퉁이 | |
102 | 24.10.1201:40 | 잠퉁이 | |
72 | 24.10.1122:06 | 잠퉁이 | |
108 | 24.10.1104:53 | 잠퉁이 | |
74 | 24.10.1104:43 | 잠퉁이 | |
67 | 24.10.1104:47 | 잠퉁이 | |
70 | 24.10.1104:35 | 잠퉁이 | |
71 | 24.10.1103:23 | 잠퉁이 | |
74 | 24.10.1103:21 | 잠퉁이 | |
68 | 24.10.1103:19 | 잠퉁이 | |
92 | 24.10.1003:28 | 잠퉁이 | |
100 | 24.10.1000:50 | 잠퉁이 | |
104 | 24.10.1000:47 | 잠퉁이 | |
82 | 24.10.1000:45 | 잠퉁이 | |
73 | 24.10.1000:41 | 잠퉁이 | |
78 | 24.10.1000:35 | 잠퉁이 | |
73 | 24.10.0904:41 | 잠퉁이 | |
92 | 24.10.0902:02 | 잠퉁이 | |
63 | 24.10.0901:59 | 잠퉁이 | |
51 | 24.10.0901:56 | 잠퉁이 | |
69 | 24.10.0901:54 | 잠퉁이 | |
52 | 24.10.0818:43 | 잠퉁이 | |
38 | 24.10.0818:42 | 잠퉁이 | |
81 | 24.10.0800:35 | 잠퉁이 | |
67 | 24.10.0800:33 | 잠퉁이 | |
69 | 24.10.0800:31 | 잠퉁이 | |
115 | 24.10.0805:25 | 제로섬 | |
77 | 24.10.0701:02 | 잠퉁이 | |
51 | 24.10.0700:57 | 잠퉁이 | |
65 | 24.10.0700:48 | 잠퉁이 | |
48 | 24.10.0700:52 | 잠퉁이 | |
53 | 24.10.0700:45 | 잠퉁이 | |
38 | 24.10.0700:41 | 잠퉁이 | |
82 | 24.10.0600:37 | 잠퉁이 | |
54 | 24.10.0600:34 | 잠퉁이 | |
65 | 24.10.0504:02 | 잠퉁이 | |
70 | 24.10.0503:59 | 잠퉁이 | |
94 | 24.10.0503:57 | 잠퉁이 |
저도 잘 쓸께요!