Difficulties with container of file syntax in Finder

Hi,

I’m trying to produce a script that searches for a wildcard file within the same folder as a source file, and then reads entries from it as a plist file. The problem is, the script is locking up when I attempt to get the container of the source file. Details are below. I’d be grateful for any help.

on run
	set plistRecords to {"EPISODENUM", "SEASONID"}
	tell application "EyeTV"
		set selected_recordings to selection of programs window
		repeat with selected_recording in selected_recordings
			set eyetvr to location of selected_recording
			display dialog eyetvr
			tell application "Finder" to set filepath to (get container of file eyetvr)
			display dialog filepath
			set eyetvp to do shell script "find " & quoted form of POSIX path of filepath & " -name \"*.eyetvp*\""
			display dialog eyetvp
			my read_plist(eyetvp, plistRecords)
		end repeat
	end tell
end run

The source file is 000000001436b8fd.eyetvr and the file I’m searching for is 0000000014263948.eyetvp. Outputs were as follows

Hi,

maybe it’s a referencing problem.
in EyeTV location of a recording results a file URL, not a string path.
Coerce the file URL to text.
Another problem is the variable filePath which is a Finder file specifier.
Finder file specifiers don’t have a POSIX path property. Coerce filePath to text too.


set plistRecords to {"EPISODENUM", "SEASONID"}

tell application "EyeTV" to set selected_recordings to selection of programs window
repeat with selected_recording in selected_recordings
	tell application "EyeTV" to set eyetvr to location of selected_recording as text
	display dialog eyetvr
	tell application "Finder" to set filepath to (get container of file eyetvr) as text
	display dialog filepath
	set eyetvp to do shell script "find " & quoted form of POSIX path of filepath & " -name \"*.eyetvp*\""
	display dialog eyetvp
	read_plist(eyetvp, plistRecords)
end repeat


Same problem, I’m afraid. No change to results.