如何使用AppleScript将文本复制到剪贴板

如何使用AppleScript将文本复制到剪贴板,applescript,clipboard,Applescript,Clipboard,我想创建一个应用程序,使用AppleScript复制系统信息并通过电子邮件发送给我自己。我知道如何发送电子邮件,以及如何使电子邮件包含剪贴板中的内容。如何使用AppleScript编码将文本复制到剪贴板 如果有帮助,可以通过电子邮件发送剪贴板中的内容: set a to "uselessdecoy@gmail.com" tell application "Mail" tell (make new outgoing message) set subject to (the clipboard) s

我想创建一个应用程序,使用AppleScript复制系统信息并通过电子邮件发送给我自己。我知道如何发送电子邮件,以及如何使电子邮件包含剪贴板中的内容。如何使用AppleScript编码将文本复制到剪贴板

如果有帮助,可以通过电子邮件发送剪贴板中的内容:

set a to "uselessdecoy@gmail.com"
tell application "Mail"
tell (make new outgoing message)
set subject to (the clipboard)
set content to "content"
make new to recipient at end of to recipients with properties {address:a}
send
end tell
end tell
您只需使用

set the clipboard to "Some text"
您还可以直接指定剪贴板的各个部分(纯文本、unicode、pict),如中所示:

set the clipboard to {text:(outputText as string), Unicode text:outputText}