InDesign CS2 - losing frame stroke and underlines

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

I’m not 100% sure what your code says, because some of it has converted into raw Apple events. InDesign’s underlines are a live feature of text; if you convert to outlines, this feature has nothing to operate on, and the underline goes away. Likewise, if you convert a whole text frame, the stroke on the frame goes away. Rather than targeting the parent text frames of the first insertion point, you need to target the text of the stories.

Marc Anthony,

That is interesting! They group I presently work with inherited this script; the person who wrote it is not in the picture anymore. I don’t know what raw Apple Events are but I’m ok with not knowing. :wink:

Will you please give me some more explanation about targeting the text of the stories and how that can solve my problem?

Thanks!