🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15501

Applied Font Issues

#15501
From: Dave_Saunders
Date: Sat, 06 Dec 2003 19:08
36 lines
2263 bytes
I'm seeing odd things happening with the applied font property of text. For example, if I select the word "text" set in Myriad Pro Regular in 2.0.2, then:

tell application "InDesign 2.0.2"
 set myText to object reference of item 1 of selection
 return applied font of myText
end tell

I get: font "Myriad Pro<tab>Regular" of application "InDesign 2.0.2"

If I do the same with InDesign CS as the target application, I get:

font "Myriad Pro" of application "InDesign CS"

Interestingly, if I add "as string" to the end of the return statement, both application return just "Myriad Pro".

Attempting to go the other way, in 2.0.2, if I do this:

tell application "InDesign 2.0.2"
 set myText to object reference of item 1 of selection
 set applied font of myText to ("Times" & tab & "Roman")
end tell

nothing happens. Looking in the event log, I see:
"set applied font of text from character 14 to character 17 of story id 128 of document "Untitled-1" to "Times<tab>Roman" so the command was passed off OK, but nothing happened.

On the other hand, if I target InDesign CS, then the font name changes to [Times Roman], the style goes blank and the text takes on the dreaded pinkness.

Aside from the fact that the story id is 132 in CS, the event log reads the same.

This all looks rather messy and not as advertised in the Scripting Guide. Am I doing something wrong? Or is there a bug here?

I get comparable results with CS using JavaScript.

Dave

PS: The forum editor lost the tabs, so I've substituted "<tab>" for where there were tab characters. Note that I did not make a mistake with the font name displayed by CS: somehow it became a space.
Technical Details
Message-ID: <2ccec789.-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

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,f6ff0a598aa4e18a,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-12-06 11:37:43 PST
From: Dave_Saunders@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: Applied Font Issues
Message-ID: <2ccec789.-1@webx.la2eafNXanI>
Date: Sat, 6 Dec 2003 11:08:37 -0800
Lines: 47
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit