在自动服务中,我有一个bash脚本,该脚本将两个变量传递给applescript,然后将这些变量输入到电子邮件中。我希望两个变量都在电子邮件中的不同行上。
on run {input, parameters}
set macPath to item 1 of input
set windowsPath to item 2 of input
set messageContent to macPath & return & linefeed & return & windowsPath
tell application "Microsoft Outlook"
activate
set theMessage to make new outgoing message with properties {content:messageContent}
open theMessage
end tell
end run
我尝试了回车,换行和转义字符,但是似乎都不起作用,并且我的消息内容总是以一行结尾。有什么办法可以在applescript中做到这一点?
答案 0 :(得分:0)
我刚刚意识到 content 属性支持“富文本”,因此可以使用<br>
标签引入换行符,例如:
tell application "Microsoft Outlook"
activate
set sendToAddress to ""
set theMessage to make new outgoing message with properties {content:"Line 1 <br> line 2"}
open theMessage
end tell