0
저는 applescript에 매우 익숙하고 다른 사람으로부터받은 스크립트를 기반으로 작업하고 있습니다. 그러나 응용 프로그램에 대해 Xcode에서 Interface Builder를 사용하여 만든 응용 프로그램으로 채널을 변경하는 데 문제가 있습니다. Elgato의 EyeTV. "/ usr/bin/osacompile 명령이 종료 코드 1과 함께 실패했습니다"라는 오류 메시지가 계속 나타납니다. 아래 코드를 포함했습니다.AppleScript로 기본 도움주세요! (Elgato EyeTV를 제어하려고 시도합니다.)
global theChannel
global theApp
global theMachine
property theMachine : "10.0.2.2"
on change_channel(channel_number)
set theChannel channel_number as integer
tell application "EyeTV" of machine theMachine
«event EyTVChch» given «class Chnm»: theChannel
end tell
end change_channel
on clicked theObject
set theApp to application "EyeTV" of machine theMachine
if name of theObject is "fox" then
change_channel(2)
else if name of theObject is "cbs" then
change_channel(3)
else if name of theObject is "nbc" then
change_channel(4)
else if name of theObject is "pbs" then
change_channel(5)
else if name of theObject is "cw" then
change_channel(6)
else if name of theObject is "abc" then
change_channel(7)
else if name of theObject is "twc" then
change_channel(9)
else if name of theObject is "bt" then
change_channel(10)
else if name of theObject is "fs" then
change_channel(11)
else if name of theObject is "cs" then
change_channel(12)
else if name of theObject is "espn" then
change_channel(13)
else if name of theObject is "espn2" then
change_channel(14)
else if name of theObject is "espnu" then
change_channel(15)
else if name of theObject is "dh" then
change_channel(20)
else if name of theObject is "dc" then
change_channel(29)
else if name of theObject is "tlc" then
change_channel(30)
else if name of theObject is "sc" then
change_channel(31)
else if name of theObject is "ng" then
change_channel(32)
else if name of theObject is "hc" then
change_channel(33)
else if name of theObject is "fn" then
change_channel(34)
else if name of theObject is "msnbc" then
change_channel(35)
else if name of theObject is "cnbc" then
change_channel(36)
else if name of theObject is "hn" then
change_channel(37)
else if name of theObject is "cnn" then
change_channel(39)
else if name of theObject is "cspan2" then
change_channel(41)
else if name of theObject is "cspan" then
change_channel(42)
else if name of theObject is "rc" then
change_channel(53)
else if name of theObject is "wolv" then
change_channel(55)
else if name of theObject is "rham" then
change_channel(56)
else if name of theObject is "rctv" then
change_channel(57)
else if name of theObject is "rlc" then
change_channel(58)
end if
end clicked
on will finish launching theObject
tell window "Main"
set theAddress to text returned of (display dialog "Enter the IP of the remote computer:" default answer "10.0.2.2" default button 2)
set theMachine to "eppc://" & theAddress
end tell
set theApp to application "EyeTV" of machine theMachine
using terms from application "Script Editor"
tell theApp
activate
if «class Fuls» is true then
set title_fullscreen to "Exit Full Screen"
else if «class Fuls» is false then
set title_fullscreen to "Enter Full Screen"
end if
set theChannel to «class Crch»
end tell
end using terms from
tell window "Main"
set title of button "fullscreen" to title_fullscreen
set the contents of text field "channel_number" to theChannel
set title of button "eyetv_quit" to "Quit EyeTV"
set isOpen to 1 as integer
end tell
end will finish launching
on will close theObject
quit
end will close