내 스크립트는 AppA에서 텍스트를 가져와 AppB의 텍스트 편집에 붙여 넣습니다. AppB가 시작되면 (스크립트에 의해) 텍스트 편집이 비활성화되어 사용자가 작업을 수행 할 때 활성화됩니다. 그 행동은 수동으로해야합니다.AppleScript로 감지 된 편집 상자
스크립트는 사용자가 오류가 발생하기 전에 실행됩니다. 내 생각은 편집 활성화되어 있는지 확인했지만이 오류가 발생합니다. 응용 프로그램 "시스템 이벤트"의 "AppB 창"을 가져올 수 없습니다. 응용 프로그램 "시스템 이벤트"의 AppB 창을 가져올 수 없습니다. 오류가 한 번만 발생합니다.
어떻게하면 오류를 피할 수 있습니까? ?
는on idle
tell application "System Events" to set AppAIsOpen to (application process "AppA" exists)
if (AppAIsOpen) then
set AppAWasOpen to true
tell application "AppA"
set hdg to TxRprt
set beam to hdg as string
end tell
if ((count beam) < 3) then set beam to text -3 thru -1 of ("000" & beam)
if (beam is not previousText) then
tell application "AppB" to launch
tell application "System Events"
tell application process "AppB"
if text field 1 of window "AppB" is enabled then -- error here
set value of text field 1 of window "AppB" to beam --or here
end if
end tell
end tell
set previousText to beam
end if
return checkInterval
else if (AppAgWasOpen) then
quit
return 1
end if
멋지게 작동합니다. 감사. – Mike