tell application "Adobe InDesign CS2"
activate
if (count documents) > 0 then
--Set color to be used for problem highlighting
tell active document
if exists swatch "text layer" then
set theColor to "text layer"
else
set theColor to make new color with properties {model:spot, space:CMYK, color value:{0.0, 100.0, 100.0, 0.0}, name:"text layer", label:""}
end if
end tell
--set working layer
if exists layer "On Text" then
set active layer of active window to layer "On Text" of active document
else
tell active document
set newLayer to make new layer
set name of newLayer to "On Text"
end tell
set active layer of active window to layer "On Text" of active document
end if
set myGraphics to all graphics of active document
if (count myGraphics) > 0 then
tell active document
repeat with i from 1 to count of myGraphics
if name of item layer of i is "Text" then
set thisItem to duplicate graphic i
set item layer of thisItem to "On Text"
set content type of thisItem to unassigned
set fill color of thisItem to theColor
set blend mode of thisItem to multiply
end if
end repeat
end tell
else
display dialog "Please open a document containing graphics and try again." buttons "OK"
end if
else
display dialog "Please open a document and try again." buttons "OK"
end if
end tell