[AS, CS4] Update Link Isn't Working Any More
Hello,
I have updated an (rather big) AppleScript from CS3 to CS4 encountering only minor problems. But there is one thing, for that I need some help.
There is a part within, which changes dimensions of an image and/or updates the link, if the user wants to (userUpdateLink and userChangeDimensions are both bools, fed by GUI-result). theDocName is a string, theImgLinkID is a string containing a number (both fed from a sqlight database).
Here's the code:
on updateInDesign(theGraphic, theDocName, theImgLinkID, userUpdateLink, userChangeDimensions)
tell application "Adobe InDesign CS4"
tell document theDocName
if userUpdateLink then
set theLink to link id (theImgLinkID as number)
set theNewLink to update theLink
set theImgLinkID to id of theNewLink
end if
if userChangeDimensions then
tell parent of link id (theImgLinkID as number)
if (horizontal scale < 0) then
set horizontal scale to -100.0
else
set horizontal scale to 100.0
end if
if (vertical scale < 0) then
set vertical scale to -100.0
else
set vertical scale to 100.0
end if
end tell
end if
end tell
end tell
return theImgLinkID
end updateInDesign
I permanently get an error on the line:
set theNewLink to update theLink
»
update link id 49430 of image id 49456 of rectangle id 49431 of page id 15272 of spread id 15261 of document "xyz.indd"
"„Adobe InDesign CS4“ hat einen Fehler erhalten: Ungültiges Objekt für diese Anforderung."