0
OmniGraffle 5.3.6을 스크립팅하려고하는데 canvas
의 layers
요소를 읽으려고합니다. AppleScript로 함수 (또는 처리기)를 전달했습니다. 나는 다음과 실행하면 :참조로 전달 된 값의 속성을 읽는 방법은 무엇입니까?
on exportToPng(theCanvas)
set layerCount to count of layers of theCanvas
end exportToPng
tell application "OmniGraffle Professional 5"
set theDocument to front document
set allCanvases to canvases of theDocument
set theCanvas to item 1 of allCanvases
my exportToPng(theCanvas)
end tell
내가받을 다음과 같은 오류가 : 내 함수를 인라인한다면
error "OmniGraffle Professional 5 got an error: Can’t make |layers| of
canvas id 1 of document \"base-dependency-diagram.graffle\" into type reference."
number -1700 from |layers| of canvas id 1 of document
"base-dependency-diagram.graffle" to reference
그러나, 다음 모든 작동합니다 :
tell application "OmniGraffle Professional 5"
set theDocument to front document
set allCanvases to canvases of theDocument
set theCanvas to item 1 of allCanvases
set layerCount to count of layers of theCanvas
end tell
내가 읽은 Passing by Reference Versus Passing by Value,하지만 도움이되지 않았습니다. 꽤 희박합니다.