open the same window with different values

i am trying to make an app that will open a window when a user clicks on a button. It only has 1 text field and i want the text in it to be different according to the title of a popup button. i also want to have various windows open at the same time
something like this???

on clicked theObject
	if the name of theObject is "Button" then
		makeNewWindow(title of popup button "popup button")
	end if
end clicked

on makeNewWindow(textString)
	make new window with properties {title:textString}
	set contents of text field "text field" to textString
end makeNewWindow

Wuld this change all the text fields of named “text field” of other windows?

hi gecko,

maybe you can simply make your app a document based applescript application - then you can create the windows (=documents) like so:

on clicked theObject
	set buttonclicked to title of theObject
	set doc to (make new document)
	tell doc
		set content of text field "tf" of window "main" to buttonclicked
	end tell
end clicked

Hope that helps,


thanks, but i already found this bit of code. i should have looked harder before i posted.