"get folder of info for" - How can this not work?

How can this not work?

tell application "Finder"
	set x to selection
	set y to x as alias
	get folder of (info for y)
end tell

When I try to test for a folder using “info for”, every property returns a value except the “folder”.

I get an event log that says: “Can’t get folder of {name:"untitled folder", creation date:date …”

Am I missing something very obvious?

Thanks for any replies.

Model: 2.5 dual G5
AppleScript: 2.0
Browser: Firefox 1.0.3
Operating System: Mac OS X (10.3.9)

You only need to use the Finder to get the selection. Try this:

tell application "Finder" to get selection
return folder of (info for (result as alias))

Model: Mac mini
AppleScript: 1.10
Browser: Safari 412
Operating System: Mac OS X (10.4)


Thanks so much for the reply. This would not have occured to me since all other properties are returned even within the tell to the Finder.

You’ve saved me much time and it’s much appreciated.