【发布时间】:2018-06-28 02:21:58
【问题描述】:
我正在尝试通过 iMessage 从桌面上的“lv”文件夹中发送随机图像。
tell application "Finder"
set theFile to some file of folder "Macintosh HD:Users:user:Desktop:lv:"
end tell
set randomImage to POSIX file theFile
tell application "Messages"
set targetBuddy to "appleid@mac.com"
set targetService to id of 1st service whose service type = iMessage
set textMessage to randomImage
set theBuddy to buddy targetBuddy of service id targetService
send textMessage to theBuddy
end tell
使用
tell application "Preview"
open theFile
end tell
我可以看出随机图像有效。但它不会传递给 iMessage。错误消息说“无法转换预期的类型”。错误代码-1700
感谢您的任何建议!
【问题讨论】:
标签: image random applescript imessage