@ Leonard
Thanks for the clarification about "refrying".
@ Stephen
As I said, I tested the script here and it works but, as they say, programming is 10% coding and 90% debugging. Will try to have a look. As for you stroke attribute question, in the lines:
set RectangleImage to (make new rectangle with properties {geometric bounds:{0, 0, new_page_height, new_page_width}})
set stroke weight of RectangleImage to (keyline_weight * 72)
set stroke alignment of RectangleImage to inside alignment
set overprint stroke of RectangleImage to true
The variable RectangleImage is a reference to the rectangle (or frame) that will have the stroke applied to so the line "set overprint stroke of RectangleImage to true" will overprint the stroke.
I quickly wrote another script that should set all strokes of rectangles, text frames and polygons in any open InDesign document to overprint, (your mac should beep 3 times when it's done) but as I mentioned earlier, writing the code is only 10% of the work
so forgive me if it doesn't work perfectly on your machine.
That being said, thumbs up to Adobe for implementing so well AppleScript into InDesign and Photoshop.
set volume 5
tell application "Adobe InDesign CS5"
activate
set dc to 1
set doc_count to (count every document)
repeat doc_count times
tell document dc
tell layout window 1
set overprint preview to true
end tell
--this is to ungroup all groups or else strokes that are in a group wont overprint
repeat
set my_groups to get every group
if the result is {} then exit repeat
if my_groups is not {} then
repeat with this_group in my_groups
ungroup this_group
end repeat
end if
end repeat
--end of code to ungroup
set my_rectangles to (every rectangle whose stroke weight is not 0.0)
set my_frames to (every text frame whose stroke weight is not 0.0)
set my_polygons to (every polygon whose stroke weight is not 0.0)
repeat with this_frame in my_frames
try
get this_frame
set overprint stroke of this_frame to true
end try
end repeat
repeat with this_rectangle in my_rectangles
try
get this_rectangle
set overprint stroke of this_rectangle to true
end try
end repeat
repeat with this_polygon in my_polygons
try
get this_polygon
set overprint stroke of this_polygon to true
end try
end repeat
end tell
set dc to dc + 1
end repeat
end tell
beep 3