In the above script 'selection' is useless. You're telling Applescript to get the 'selection', and although it compiles it doesn't know what you're talking about. 'selection' in this case is a property of the Finder.
------------------------------------------------------------------------------------------------
try
tell application "Finder"
activate
set theFile to selection as alias list
if length of theFile = 1 then
set theFile to item 1 of theFile
set infoWindow to open information window of theFile
set infoWindowName to name of infoWindow
tell application "System Events"
tell application process "Finder"
tell window infoWindowName
keystroke tab
delay 0.1
keystroke "c" using command down
end tell
end tell
end tell
close infoWindow
else
error "Something is wrong with the selection!"
end if
end tell
on error errMsg number errNum
set {cr, sep} to {return, "------------------------------------------"}
set e to sep & cr & "Error: " & errMsg & cr & sep & cr & "Error Number: " & errNum & cr & sep
beep
display dialog e
end try
------------------------------------------------------------------------------------------------
--
Best Regards,
Chris