Illustrator document name – problem with diacritics

Hi to everyone,

i have this problem with Adobe Illustrator CS6.
My script have to copy the name of document and insert it to the contents of existing text frame (in document the text frame has name “mustr”). Script is very simple, but does not work properly. It removes all diacritics from the name.

tell application "Adobe Illustrator" tell document 1 set zakazka to name set contents of text frame "mustr" to zakazka end tell end tell
So if the document has name “89568-Test čřžýáíé”, result is text frame in illustrator with visible contents “89568-Test crzyaie”

Can anyone help with correction of the script?

Thanks a lot,

Jan Tihlarik

Try this:

	tell document 1
		set thePath to file path as text
		set saveTID to AppleScript's text item delimiters
		set AppleScript's text item delimiters to {":"}
		set zakazka to text item -1 of thePath
		set AppleScript's text item delimiters to saveTID
		set contents of text frame "mustr" to zakazka
	end tell

Hi,

thank for reply, but result is same as with my script.
If i look in script debugger on value of variable “zakazka”, it is correct with both scripts.

If i will set the name of random layer to zakazka, it is correct.
But contents of the text frame is without diacritics.

Interesting is, that if i will manually “ without variable “ set the contents of the text frame “mustr” to string “89568-Test čřžýáíé”, it works.

So for example, i have two text frames in illustrator document with names “mustr1” and “mustr2”
See the script:

tell application "Adobe Illustrator"
	tell document 1
		set zakazka to name
		set contents of the text frame "mustr1" to "89568-Test čřžýáíé"
		set contents of the text frame "mustr2" to zakazka
	end tell
end tell

But the result is:
text frame “mustr1”: 89568-Test čřžýáíé
text frame “mustr2”: 89568-Test crzyaie

EDIT: when i get properties of text frame “mustr2”, i see contents:“89568-Test čřžýáíé”.

any idea?

Thanks,

Jan Tihlarik

I know why, but I don’t have a solution. The problem stems from how the HFS file system stores accented characters – it uses a custom decomposed form. However that’s being converted to an AppleScript string in an encoding format Illustrator doesn’t like.

I tried using AppleScriptObjC and the precomposedStringWithCompatibilityMapping method, but that results in 89568-Test cˇrˇzˇy´Ã¡Ã­Ã©.ai.

Other than logging a bug, I’m not sure what else I can suggest.

Interesting,

but when i do the script and after execution i copy new contents of text frame in illustrator and paste it to (for example) TextEdit, it looks allright with diacritics. As i wrote in last post, when i get properties of text frame, it looks allright.
Maybe illustrator CS6 bug?

Can somebody check this in other AI version?

I am really confused of this, but thanks for helping.

Jan

It’s an Illustrator bug all right. If I do this:

tell application "Adobe Illustrator"
	tell document 1
		set x to name --> "89568-Test čřžýáíé.ai"
	end tell
end tell

tell application "Adobe InDesign CC 2014"
	tell document 1
		set contents of text frame 1 to x
	end tell
end tell

I get what you want in the InDesign frame.

And I’m using Illustrator CC 2014, so a new version is not the answer.

All I can suggest is www.adobe.com/misc/bugreport.html.