set background color of text field "Test" to {0, 0, 0}?

What is wrong with this line?

set background color of text field “Test” to {0, 0, 0}

Depends on how you’re using it. Is it causing an error?

Is that the command to set the background color? Is “background color” a property?

“Can’t set «class texF» “Test” to {0, 0, 0}. (-10006)”

I want to set the background color of a text field.

Open the link to AppleScriptKit.sdef in your project.

Your application doesn’t know where to find text field "Test"; You must specify a complete reference to it.

Try one of these:


set background color of text field "Test" of window "whatever" to {0, 0, 0}

-- Check out the `window` property
set background color of text field "Test" of window of theObject to {0, 0, 0}

-- Check out the `super view` property
set background color of text field "Test" of super view of theObject to {0, 0, 0}

Thanks. I didn’t have the window referenced.