带有新行的击键字符串

Cot*_*ten 2 applescript

考虑这个

set cannedResponse to "Hello,
Thanks for your support request!
We'll take a look at the issue and get back to you as fast as possible"

tell application "System Events" to keystroke cannedResponse
Run Code Online (Sandbox Code Playgroud)

它打印文本但没有返回字符。我怎样才能得到它们?

reg*_*633 5

尝试这个...

set cannedResponse to "Hello,
Thanks for your support request!
We'll take a look at the issue and get back to you as fast as possible"

set theList to paragraphs of cannedResponse
set listCount to count of theList
repeat with i from 1 to listCount
    tell application "System Events"
        keystroke item i of theList
        if i is not listCount then keystroke return
    end tell
end repeat
Run Code Online (Sandbox Code Playgroud)