illustrator find replace selection of text

hey guys, so… im embarrassed to even post what i have so far, but…


tell application "Adobe Illustrator"
	set mydoc to current document
	set selectedobjects to selection of mydoc
	set bananas to count of text frames of selection of mydoc
	
	repeat with current_text_frame from 1 to bananas
		set whatitis to (contents of text frame text_frame) as text
		display dialog whatitis
		.......
 
	end repeat
	
end tell


i havent even finished it because im at a road block. what id really like to do is specify an area, and have a prompt come up for each text box within that area that tells me what’s currently there and asks what to replace it with. a sort of quick and dirty template editor.

what id settle for is selecting an area manually and going from there.

any help would be much appreciated.

thanks,
jordan

I reworked the method to get the text frames to take advantage of the “selected” property of the page items. I think it is a good start to what you are trying to accomplish.

tell application "Adobe Illustrator"
	set TextFrames to every text frame of document 1 whose selected is true
	repeat with aFrame in TextFrames
		set oldText to contents of aFrame
		set newText to text returned of (display dialog "Current Text: " & oldText default answer oldText)
		set contents of aFrame to newText
	end repeat
end tell

im not at work right now… when i get back to the office in a few hours ill try this out. i just wanted to thank you… this looks beautiful. i cant wait to start playing tomorrow.

-jl