AppDelegate.applescript는Xcode :이 코코 스크립트 응용 프로그램의 토글 단추를 만들려면 어떻게해야합니까?
-- iTunes Switcher
--
-- Created by admini on 11/13/12.
-- Copyright (c) 2012 Bdaniels. No rights reserved.
--
script AppDelegate
property parent : class "NSObject"
on ButtonHandlerActivationOn_(sender)
tell application "iTunes" to quit
do shell script "/usr/bin/defaults write com.apple.iTunes StoreActivationMode -integer 1"
delay 1
do shell script "open -a itunes"
end ButtonHandlerActivationOn
on ButtonHandlerActivationOff_(sender)
tell application "iTunes" to quit
do shell script "/usr/bin/defaults write com.apple.iTunes StoreActivationMode -integer 0"
delay 1
do shell script "open -a itunes"
end ButtonHandlerActivationOff
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
여기에 내가 상태가 설정되어있는 경우 녹색 빛을 넣어하고자하는 UI http://imgur.com/8xO9K4c
의 스크린 샷이다. 이것에 대한 도움이 될 것입니다! 여기에 두 개의 버튼이 더 있습니다. 그러나 나는 "너무 많은 코드"를 내 게시물에 포함 시켰고 stackoverflow를 사용하여 게시 할 수 없었기 때문에 생략했습니다.
미리 감사드립니다.