What does errAEWrongNumberArgs error mean running AppleScript? I copied a script that I found online, but it will not run. The error I receive is 

Logical operator NOT used with other than 1 term (errAEWrongNumberArgs:-1721)

Here is the script.

on run {input, parameters}

-- Bring Screenflick to the front
tell application "Screenflick" to activate

-- Start a recording
tell application "System Events"
    tell process "Screenflick"
        -- Open the Recording view
        click menu item "Recording" of menu "Window" of menu bar 1
        -- Set the recording timer
        tell window "Screenflick"
            -- Turn the timer off
            tell checkbox "Set Timer"
                if (its value as boolean) then click it
            end tell
            -- Turn the timer on
            click checkbox "Set Timer"
            tell sheet 1
                set value of text field 1 to "0" -- hours
                set value of text field 2 to "0" -- minutes
                set value of text field 3 to "10" -- seconds
                keystroke return
            end tell
        end tell            
        -- Start Recording (Open the Screen Selection view)
        click menu item "Start Recording" of menu "Record" of menu bar 1    
        delay 1
        -- Set the screen area to record
        tell window "Selection Window"
            perform action "AXRaise" -- makes the window frontmost
            tell pop up button "Selection Type"
                click -- Show the menu
                click menu item "Fixed Size" of menu 1
            end tell    
            -- Set the left / bottom of the selected area in global screen points
            -- Must set the values to strings, not integers
            set value of text field "Left" to "100"
            set value of text field "Bottom" to "100"
            -- Triggers Screenflick to use those values
            -- (only confirming one of the fields is fine)
            perform action "AXConfirm" of text field "Left"
            -- Set width and height of the recording area
            set value of text field "Width" to "800"
            set value of text field "Height" to "600"
            perform action "AXConfirm" of text field "Width"
        end tell
        -- Now start recording
        click button "Record" of window "Selection Window"
    end tell        
end tell
return input


end run

How can I figure out this error code?
With a script that long, you have two options to cure an error:


Use a debugger to step through the code and find out which of the 40 lines contains the error and inspect the value of the errors and the syntax for the command that’s being run or throws the error
Use the concept of minimum complete verifiable example - where you will remove the code logical part by logical part until you have the smallest amount of code that produces the errors. In this case, removing (or commenting out) all of the delays, all inner loops and have only a couple of lines of code to debug.


For debugger, the Apple tool is barely OK - so I would run and not walk to something like https://latenightsw.com/ Script Debugger which has a fully featured trial and then a free tier of functionality that will suit your needs perfectly.