Hello,
Hoping someone can please help me figure this out. I am working with text that has to get outlined at the end of a project. Sometimes we have to use a stroke around the text frame and underline certain words. When we use the following script to outline the text and then make a new layer, we lose the stroke and underlines all together. Also, if we have text on a path, this script does not work at all.
I am new and not sure how to tell AppleScript how to do this. Any help would be appreciated!
tell application "Adobe InDesign CS2"
if exists document 1 then
tell active document
try
--repeat with a in every text frame
set y to parent text frames of insertion point 1 of every story
repeat with j from 1 to count y
create outlines item 1 of item j of y without delete original
end repeat
on error errmess
display dialog "Error creating outlines" & return & errmess
end try
--make new layer for text
set TextLayer to make layer
try
set name of TextLayer to "live copy"
on error
--name exists
end try
-- ungroup all items first
try
set x to every group
repeat with i from 1 to count x
«event K2 ugrp» item i of x
end repeat
on error
-- no grouped items found
end try
--move all text frames to a new layer
try
set x to every text frame
repeat with i from 1 to count x
«event Qdrwmove» item i of x given «class insh»:TextLayer
end repeat
on error msg
--no text frames were found
end try
set visible of TextLayer to false
end tell
else
display dialog "No active document"
end if
end tell