AppDelegate.applescript
-- 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
状態がオンになったら青信号を出したいのですが。これに関するどんな助けも素晴らしいでしょう!ここにはさらに2つのボタンがありますが、投稿に「コードが多すぎます」とスタックオーバーフローで投稿できないため、ボタンを省略しました。
前もって感謝します!