2014-01-17 152 views
5

我想创建一个使用AppleScript的应用程序来复制系统信息并将其发送给我自己。我知道要做电子邮件的方面,以及如何让电子邮件拥有剪贴板中的任何内容。我如何使用AppleScript编码将文本复制到剪贴板?如何使用AppleScript将文本复制到剪贴板

如果它帮助这里是电子邮件无论是在剪贴板方式:

set a to "[email protected]" 
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 

回答

8

您只需使用

set the clipboard to "Some text" 

还可以分配到剪贴板的各个部分(平原文本,unicode,图片),如:

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