Keeping Fonts from Excel file into Adobe Illustrator Document

Hi Guys,

I have a script that gets the values of a range of Excel cells, and creates a text string of them. No problems there.

The script then creates an Adobe Illustrator document with a text box, and fills the text box with the text string from Excel. No problems there.

My Excel Cell has text in that has different fonts in the same line of text.

For example:
✉ ☎ Address 1

The envelope and telephone sign are in Zapf Dingbats, and the rest is in Univers.

When the text ends up in the Illustrator document, it appears all in one font.

Is there a way to keep the fonts that are in the Excel cell, ‘true’ when it arrives in Illustrator ???

Grateful for any help you guys can give.

My script is below.

tell application “Microsoft Excel”
try
set AppleScript’s text item delimiters to space
set myWords to (value of cell “A1:A100”)
set myAddress to myWords as string

	--set AppleScript's text item delimiters to ""
end try

end tell

tell application “Adobe Illustrator”
activate

make new document

--	Create a rectangle that will be used as the first text area
set theRectanglePath to make new rectangle at beginning of document 1 ¬
	with properties {position:{5, 785}, height:400, width:600}

--	Create the area text  object
set theText to make new text frame at beginning of document 1 ¬
	with properties {name:"T1", kind:area text, text path:theRectanglePath, contents:myAddress}

-- Set the characteristics of the text associated with the newly created text frame
set properties of every word of the text of theText to ¬
	{fill color:{black:100}, size:7}

--{fill color:{black:100}, text font:text font "Helvetica", size:7}

end tell

Use the below mentioned code to get your problem solved. Sorry for a very late reply.


tell application "Microsoft Excel"
	activate
	tell worksheet 1 of active workbook
		set usedrange to (count of rows of column 1 of used range) as string
		set swaplist to value of range ("A1:A" & usedrange as string)
		select range ("A1:A" & usedrange as string)
	end tell
	activate
	tell application "System Events"
		tell process "Microsoft Excel"
			--keystroke "C" using command
			click menu item "Copy" of menu 1 of menu bar item "Edit" of menu bar 1
		end tell
	end tell
end tell

tell application "Adobe Illustrator"
	activate
	make new document
	activate
	tell application "System Events"
		tell process "Adobe Illustrator"
			click menu item "Paste" of menu 1 of menu bar item "Edit" of menu bar 1
		end tell
	end tell
	set properties of every word of every story of document 1 to {fill color:{black:100}, size:7}
end tell

Please reply if this script suits your need.