2014-01-17 118 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}