屏幕截图
我们学校使用MACOS。每次我打开这个网站,我都需要手动输入一个代码。如何用一个命令完成这两个步骤?
到目前为止,我只迈出了第一步,使用命令行open-a"谷歌浏览器";https://assessments.cem.org/incas/GetSessionID.aspx?regkey=378BDA36-F094-4XXXXXXXXXXXXXX";
步骤2是如何嵌入命令行的?
到目前为止,我只迈出了第一步,使用命令行open-a"谷歌浏览器";https://assessments.cem.org/incas/GetSessionID.aspx?regkey=378BDA36-F094-4XXXXXXXXXXXXXX";
步骤2是如何嵌入命令行的?
这是一个完整的AppleScript解决方案。你所需要做的就是编辑代码的第三行。。。通过用实际代码替换1234567
,您需要插入
property theValue : "1234567" -- Change to actual code to enter
global assessmentsCemTab
property theURL : "https://assessments.cem.org/black/RegKeySubmit.html"
property theValue : "1234567" -- Change to actual code to enter
tell application "Google Chrome"
activate
tell window 1
set assessmentsCemTab to make new tab with properties {URL:theURL}
repeat while active tab is loading
delay 0.1
end repeat
end tell
end tell
delay 0.1
inputByID("MainContent_txtRegKey", theValue)
to inputByID(theID, theValue)
tell application "Google Chrome"
execute (a reference to assessmentsCemTab) javascript ¬
"document.getElementById('" & theID & "').value ='" & theValue & "';"
delay 0.1
execute (a reference to assessmentsCemTab) javascript ¬
"document.getElementById('MainContent_btnSubmitReg').click();"
end tell
end inputByID