Problem with evaluation in record

What can I do to get this work…?


set iBook to {name:"iBook", IPnr:"192.168.1.1", HDname:"iB HD"}
set iBook2 to {name:"iBook2", IPnr:"192.168.1.21", HDname:"iB HD2"}
set G4 to {name:"G4", IPnr:"192.168.1.2", HDname:"G4 HD"}
set inch12 to {name:"12inch", IPnr:"192.168.1.91", HDname:"Turb"}
set inch15 to {name:"15inch", IPnr:"192.168.1.23", HDname:"Burb"}
set G5 to {name:"G5", IPnr:"192.168.1.22", HDname:"G5 HD"}
set iMac to {name:"iMac", IPnr:"192.168.1.17", HDname:"iMac HD"}
set tC to {iBook, iBook2, G4, inch12, inch15, G5, iMac}
return every item in tC whose name ≠ "G4"

The filter reference form only works for elements in an application’s Apple Event Object Model, and only then where the application supports it (most do). For plain old AppleScript data, it’s a case of do-it-yourself:

set iBook to {name:"iBook", IPnr:"192.168.1.1", HDname:"iB HD"}
set iBook2 to {name:"iBook2", IPnr:"192.168.1.21", HDname:"iB HD2"}
set G4 to {name:"G4", IPnr:"192.168.1.2", HDname:"G4 HD"}
set inch12 to {name:"12inch", IPnr:"192.168.1.91", HDname:"Turb"}
set inch15 to {name:"15inch", IPnr:"192.168.1.23", HDname:"Burb"}
set G5 to {name:"G5", IPnr:"192.168.1.22", HDname:"G5 HD"}
set iMac to {name:"iMac", IPnr:"192.168.1.17", HDname:"iMac HD"}
set tC to {iBook, iBook2, G4, inch12, inch15, G5, iMac}

set resultList to {}
repeat with itemRef in tC
	if itemRef's name ≠ "G4" then set end of resultList to itemRef's contents
end repeat
return resultList

Thanks for that - I figured out the same - but I can’t see why this simple evaluation couldn’t go in 1 statement.