-1

screenshot

Our school uses MACOS. Every time I open this website, I need to manually input a code. How can I complete these two steps with one command?

I've only taken the first step so far, Use the command line open - a "Google Chrome" https://assessments.cem.org/incas/GetSessionID.aspx?regkey=378BDA36-F094-4XXXXXXXXXXXXXXX"

How does Step 2 embed in the command line?

I've only taken the first step so far, Use the command line open - a "Google Chrome" https://assessments.cem.org/incas/GetSessionID.aspx?regkey=378BDA36-F094-4XXXXXXXXXXXXXXX"

How does Step 2 embed in the command line?

1 Answers1

0

This is a full AppleScript solution. All you need to do is edit the third line of the code... By replacing the 1234567 with the actual code you need to insert

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
wch1zpink
  • 3,026
  • 1
  • 8
  • 19