please help me with my code.

i am having trouble with a applescript. i want it to gather information from four textboxes and use it in a “tell application event” this script works fine as an applescript but when i put it in an application environment it stops working.
original code i got from some site


set theSumm to "Pay My Bill Soon!"
--set dueDate to ""
set theUrl to "http://www.paymybillexample.com"
set thepriority to 1
set theNote to "notes here"

tell application "iCal"
	make todo at end of events of (item 1 of every calendar) with properties {summary:theSumm, url:theUrl, priority:thepriority, description:theNote}
end tell

my edits to that script

-- Qwik ToDo.applescript
-- Qwik ToDo

--  Created by Derek Frelow on 12/8/09.
--  Copyright 2009 FIREstorm pcs. All rights reserved.

on action theobject
	--if enter is pressed skip to next line	
end action

on clicked theobject
set theSumm to contents of text field "todoTitle"
	--set dueDate to ""
	set theURL to "http://www.paymybillexample.com"
	set thepriority to 1
	set theNote to "notes here"
	
	tell application "iCal"
		make todo at end of events of (item 1 of every calendar) with properties {summary:theSumm, due date:dueDate, url:theURL, priority:thepriority, description:theNote}
	end tell
	
end clicked



am relitive noob so if you figure out whats wrong with the script just post the script with revisions. I learn best when comparing the 2 scripts

Hi,

I guess, there is a missing reference. The text field is probably an element of a window.
The window must be named properly in Interface Builder


.
set theSumm to string value of text field "todoTitle" of window "main"
.

thank you so much! thats odd because i have a nother application (that works) its perfect no problems at all with out “as string”

how would i get the input from a slider

This should do it:

on action theObject
	set SliderValue to contents of slider 1 of window 1
end action

(Don’t forget to connect the slider to the right script)