Applescript 中的 Outlook 电子邮件 - 无法输入文本错误

问题描述 投票:0回答:1

我正在使用 Applescript 在 Outlook 中生成电子邮件,并尝试为

content
字段组合两个项目(来自两个不同的变量)。我的项目具有以下格式:

set selectedstring to item myindex of myList -- selected string is "string1"

并且这样使用:

set theEmailText to (selectedstring) & "additional text"

tell application "Microsoft Outlook"
    set newMessage to make new outgoing message with properties {subject:"The Subject", content:theEmailText}
    open newMessage
    get newMessage
end tell

但是当我运行此脚本时,我收到以下错误:

Microsoft Outlook got an error: Can’t make {"string1", "additional text"} into type text.

我需要采取额外的步骤才能将其转换为可用于

content
字段的字符串吗?

macos concatenation applescript
1个回答
0
投票

将列表强制转换为字符串,如下所示,这有效,感谢 red_menace

content:theEmailText as string
© www.soinside.com 2019 - 2024. All rights reserved.