Easy answer just starting to Learn Please help.

on clicked theObject
	set theName to text contents of "nameField" as string
	get theName
	display theName in "answerField" as string
end clicked

ok so here is my code it is just something so i can learn. I have an interface built that just has a text enter field called “nameField” and another field to display whatever the user types in the first field after clicking the button. Im getting an error that says “cant get type to reference” or something similiar. So all im asking is how to get text from a text field and display it into another text field.

This should do it…

on clicked theObject
	if name of theObject is "copyButton" then --> "copyButton" is the name you've given to your button
		set theText to (content of text field "nameField" of window "yourWindow") as string
		set content of text field "answerField" of window "yourWindow" to theText
	end if
end clicked

You should wrap the code for each individual button in an if/else block of it’s own, otherwise your app can have only one button. Also, I typically use the ‘content’ property, rather than the ‘contents’ property when referencing an object’s value. There are some cases where you MUST use the contents property, but there are also others where the contents property returns an unexpected value and causes errors that are sometimes hard to track down. And, make sure to reference the window that the objects are in, or you’ll get errors for that too.

Good luck, and welcome…

P.S. This should be posted over at the Applescript Studio/Xcode Forum.

Thank you so much buddy, sorry for the wrong placing.

I still got an error when compiling it says "cant get “nameField” of window “main”
any ideas?

Sorry. I made a typo. :o

The line that once read…

set theText to (content of "nameField" of window "yourWindow") as string

…should read…

set theText to (content of text field "nameField" of window "yourWindow") as string

I typed it out in the post form and didn’t compile it. Should work now, though. Oops…:cool:

Thank you sir.

[Moving to AS Studio forum]