Choose only the first input file from input
The following example AppleScript code is the minimum coding to achieve the goal presented in the OP, that is to only act on the first file dropped on the Automator created AppleScript application using a single Run AppleScript action:
on run {input, parameters}
    
    if input is {} then
        set inputFile1 to ¬
            quoted form of POSIX path of ¬
            (choose file with prompt &quot;Please select a file to process:&quot;)
    else
        set inputFile1 to quoted form of ¬
            (POSIX path of first item of input)
    end if
    
    tell application &quot;Terminal&quot;
        if not (exists window 1) then reopen
        activate
        do script &quot;echo&quot; &amp; space &amp; inputFile1 in window 1
    end tell
    
end run


Note the use of echo in the do script command for testing purposes, instead of xxx as in the OP.



Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.