테스트, 널/정의되지 않은 값의 애플 스크립트의 아날로그. 대신 기본 이미지가 있다면
on notify_growl(theName, theTitle, theDescription, theImage)
tell application "Growl"
if theImage is missing value then
notify with name theName title theTitle description theDescription ¬
application name "iChat"
else
notify with name theName title theTitle description theDescription ¬
application name "iChat" image theImage
end if
end tell
end notify_growl
, 당신은 기본 이미지의
on notify_growl(theName, theTitle, theDescription, theImage)
tell application "Growl"
if theImage is missing value then set theImage to defaultImage
notify with name theName title theTitle description theDescription ¬
application name "iChat" image theImage
end tell
end notify_growl
을 쓸 수있다 : 당신은 그냥 이미지를 생략하려는 경우 귀하의 경우, 그것은 다음과 같을 것
set defaultImageFile to open for access POSIX file "/some/file/path"
set defaultImage to read defaultImageFile as "JPEG"
close defaultImageFile
가있을 수있는 쉬운 방법을하지만,이
은 당신에게 이미지를 얻을 것이다, 당신이 뭔가를 할 수 있습니다. 그러나, 귀하의 경우에는 효과가 없을만큼 느립니다.
+1 답변이 해결책이기 때문에 나는 직접 질문에 대답했기 때문에 @antal에게 최선의 답을주었습니다. – finiteloop