Applescript 网络表单

Applescript Webforms

我正在尝试制作一个在 mxtoolbox.com 上提交表单的 applescript,该表单在此 link:

使用 AJAX

http://mxtoolbox.com/EmailHeaders.aspx

tell application "Safari"
    activate
    tell (make new document) to set URL to "http://mxtoolbox.com/EmailHeaders.aspx"
    delay 10
    tell application "System Events"
-- Copies text from variable headerText to clipboard and paste. Faster than keystroke headerText
        set the clipboard to headerText
        keystroke "v" using command down

    end tell
end tell

有什么想法吗?

建议如下,但仍然无效:

tell application "Safari"
    activate
    tell (make new document) to set URL to "http://mxtoolbox.com/EmailHeaders.aspx"
    delay 10
    tell application "System Events"
        set the clipboard to headerText
        keystroke "v" using command down
        tell application "Safari"
            do JavaScript ("
document.getElementById('ctl00_ContentPlaceHolder1_txtToolInput').value='" & headerText as text) & "';
document.getElementById('ctl00_ContentPlaceHolder1_btnAction').click();
" in document 1
        end tell
    end tell
end tell

你可以用 JavaScript:

set headerText to "test"

tell application "Safari"
    activate
    tell (make new document) to set URL to "http://mxtoolbox.com/EmailHeaders.aspx"
    delay 5

    do JavaScript "
    document.getElementById('ctl00_ContentPlaceHolder1_txtToolInput').value=" & quoted form of headerText & ";
    document.getElementById('ctl00_ContentPlaceHolder1_btnAction').click()" in document 1
end tell