我正在尝试制作一个在mxtoolbox.com上提交表单的applescript,该表单在此链接上使用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发布于 2016-02-19 09:07:42
您可以使用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 tellhttps://stackoverflow.com/questions/35492116
复制相似问题