🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15789

Re: Unicode character in a comparison (2.0.2 AS)

#15789
From: Gilles_Le_Pors
Date: Sun, 16 Nov 2003 16:45
56 lines
2597 bytes
Chris,

Thanks for the suggestion. Unfortunately,

set MyFound to (first character of paragraph 2 of MyTextFrame is "<E00D>")

doesn't work either.

I have discovered that:

1) If I insert the ornament character using the "Insert Glyph" palette, Applescript tells me that it is a "3", not the Unicode character <E00D> (but it does look and print like the Unicode character <E00D> of the Adobe Caslon Pro font).

2) If I insert the ornament character using Applescript, Applescript tells me that it is the Unicode character <E00D>.

3) The following script doesn't work at all:

tell application "InDesign 2.0.2"
	set MyTextFrame to page item "PaveCorpsDuTexte" of active document
	set paragraph 2 of MyTextFrame to "<E00D>" & return
	get the index of the paragraphs of MyTextFrame whose contents contains "<E00D>"
	--result: {166, 472}
	get character 1 of paragraph 2 of MyTextFrame
	--result: "<E00D>"
	set MyFound to (character 1 of paragraph 2 of MyTextFrame is "<E00D>")
	--result: false
	display dialog (MyFound)
end tell

4) Whereas the following script kind of work:

tell application "InDesign 2.0.2"
	set MyTextFrame to page item "PaveCorpsDuTexte" of active document
	set paragraph 2 of MyTextFrame to "<E00D>" & return
	get the index of the paragraphs of MyTextFrame whose contents contains "<E00D>"
	--result: {166, 472}
	get character 1 of paragraph 2 of MyTextFrame
	--result: "<E00D>"
	set MyCharacter to character 1 of paragraph 2 of MyTextFrame
	set MyFound to (MyCharacter is "<E00D>")
	--result: true
	display dialog (MyFound)
end tell

So, now, my problems are:

I don't understand why the outcome of 3 is not the same as the outcome of 4 (I can live with that).

I don't know how to make the difference between "<E00D>" and "3" when I have inserted the glyph in the document using the UI.

So, again, any help appreciated.

Thanks again, Chris.

Yours Sincerely,

Gilles Le Pors
Technical Details
Message-ID: <2cce67ca.1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
References: <2cce67ca.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,99b09d14135470c
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-11-16 09:07:48 PST
From: Gilles_Le_Pors@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: Unicode character in a comparison (2.0.2 AS)
Message-ID: <2cce67ca.1@webx.la2eafNXanI>
Date: Sun, 16 Nov 2003 08:45:16 -0800
References: <2cce67ca.-1@webx.la2eafNXanI>
Lines: 65
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit