InDesign Links

When I links the some .psd in indesign, i wnats to use object layer option. when i want to use number of layers in PSD. But how can i use a script for only using the option When Updating Link: Keep Layer Visibility Overrides. please suggest me

—Gopal

This is the script anyone can me out

tell application “Adobe InDesign CS2”
tell document 1
activate 1
set var_targetlinks to every link
set var_linkcount to count of links
repeat with j from 1 to var_linkcount
tell graphic layer options of parent of link j
set update link option to keep overrides
try
set update link option to keep overrides
set current visibility of graphic layer to keep overrides
set current visibility of graphic layer 2 to true
end try
end tell
end repeat
end tell
end tell