Suggestion for InDesign Command

Hi

When a image box is contained in a group, nested in another group and all is groupeda and locked, InDesign return that properties of parent box of image (the box that contains the image) is locked.
This is not completely true.
If I need to relink the image to a new optimized image (for optimization project) I need before to unlock the box but box is not really locked, so it return error.
What is locked is a “father” group (that can be nested).

The question is: I need to iterate and try to unlock the objects, relink and after lock them again or there is a trick to solve the question?

Ame

About:

If I need to relink the image to a new optimized image (for optimization project) I need before to unlock the box but box is not really locked, so it return error.

More precisely is:
When image is relinked to the new optimized image, the previous flag about box say “locked” so the unlock result is OK. Relink is OK (relink works even if the box is locked).
Set properties of image need that box must be unlocked (this is required to solve the rounding to 100 % the decimals value of H and V scale of image in InDesign).
So, because box is a part of group (and this can be nested…) and the last group object is locked, when I try to reassign the lock to the original parent of image (the box that contains the image) INDD return error because the operation is not permitted (locked group cannot be contains another locked object).

I’m working on a handler to get object reference to the object that is locked.
In next hours I will post the solution.

Ame

For scripter that need to discover the Reference of box locked (in a series of nested group objects) this is the routine I developed:

tell application "Adobe InDesign CS5.5"
	tell active document
		set boxRef to parent of link 1 -- just for example
	end tell
end tell

-- Can return something like:
-- image id 206 of rectangle id 203 of group id 220 of group id 223 of group id 225 of spread id 188 of document id 1 of application "Adobe InDesign CS5.5"

set lockedBoxRef to checkLock(boxRef)
-- return group id 225 of spread id 188 of document id 1 of application "Adobe InDesign CS5.5"
-- The reference of locked group

on checkLock(boxParente)
	tell application "Adobe InDesign CS5.5"
		tell active document
			try
				set boxLocked to locked of boxParente
				if boxLocked is true then
					set locked of boxParente to false
					return boxParente
				else
					return ""
				end if
			on error msg number errnum
				set boxParente to parent of boxParente
				checkLock(boxParente) of me
			end try
		end tell
	end tell
end checkLock

Ame