tell/scoping problem

i’m trying to extract schedules from eyetv, storing them in a script object:


script etvProgram
	property parent : tvpiProgram
	property UID : missing value
end

on getEtvList()
	set etvList to {} -- global
	tell application "EyeTV"
		with timeout of 3 seconds
			set etvList to every program whose start time > now or enabled is false
			repeat with etvp in etvList
				set eid to etvp's unique ID as integer
				tell me
					display dialog "getEtvList1:" & eid
					copy etvProgram to etvSched
					copy eid to etvSched's UID
					display dialog "getEtvList1b:" & etvSched's UID
					set end of etvList to etvSched
				end tell
			end repeat
		end timeout
	end tell
	
	repeat with etvSched in etvList
		set eid to etvSched's UID
		display dialog "getEtvList2:" & eid
	end repeat
end getEtvList

and this is what i get:


tell application "EyeTV"
	get every program whose start time > date "Thursday, June 24, 2010 3:29:41 PM" or enabled = false
		{program id 2.91930666E+8, program id 2.90092509E+8, program id 2.90090782E+8, program id 2.93717284E+8, program id 2.9185951E+8}
	get unique ID of program id 2.91930666E+8
		2.91930666E+8
end tell
tell current application
	display dialog "getEtvList1:291930666"
		{button returned:"OK"}
	display dialog "getEtvList1b:291930666"
		{button returned:"OK"}
end tell
...
others returned ok
...
tell application "EyeTV"
	get UID of program id 2.91930666E+8
		"EyeTV got an error: Can't get UID of program id 2.91930666E+8."

xkweez me? where did eyetv get told anything about my local uid? obviously i am totally ignorant of a/s’s scoping majick:-( any clues would be appreciated, specifically on how to save etvp’s unique ID as integer, indepentently of eyetv.

oops, i was reusing the list of eyetv structs…fixed it:


			set etvProgs to every program whose start time > now or enabled is false
			repeat with etvp in etvProgs

any everything’s just peechee…when run in script editor.

but when i run as a stay-open app, it hangs on storing eyetv info in my script objects:


repeat with etvSched in etvList
	tell etvSched 
		tell application "EyeTV"
			with timeout of 3 seconds
				tell program id (my UID)
					copy its start time to std
					copy (((its duration) / minutes) as integer) to dur
					copy its enabled to isEnabled
					copy its repeats to rpts
					copy its channel number to chStr
					copy its title to prgrmTitle
					copy its description to descr
				end tell
			end timeout
		end tell