Re: Fonts in InDesign CS
Re: Fonts in InDesign CS
- Subject: Re: Fonts in InDesign CS
- From: Courtney Schwartz <email@hidden>
- Date: Wed, 17 Nov 2004 15:21:44 -0500
Ah... yeah, you see how you're accessing the text from inside the text frame? That means that you should set the "applied font" and the "font style" separately, not in one line. (If I recall, the one-liner only works if you're setting it from the application level, not inside the text frame or text level...)
For example:
set applied font of every text to ("Aachen-Bold")
should be:
set applied font of every text to "Aachen"
set font style of every text to "Bold"
They're actually two *separate* properties of the text class, and you should treat them as such at that level. So your code should look like:
<x-tad-smaller>tell</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>application</x-tad-smaller><x-tad-smaller> "InDesign CS"
</x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>document</x-tad-smaller><x-tad-smaller> 1
</x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>text frame</x-tad-smaller><x-tad-smaller> 1
</x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>text</x-tad-smaller><x-tad-smaller> 1
</x-tad-smaller><x-tad-smaller>set</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>applied paragraph style</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>to</x-tad-smaller><x-tad-smaller> "Center" --</x-tad-smaller> paragraph style used in document<x-tad-smaller>
</x-tad-smaller><x-tad-smaller>set</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>applied font</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>to</x-tad-smaller><x-tad-smaller> "Aachen" --This line is now broken down into 2 separate "set" statements.
</x-tad-smaller><x-tad-smaller>set</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>font style</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>to</x-tad-smaller><x-tad-smaller> "Bold"
</x-tad-smaller><x-tad-smaller>set</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>point size</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>to</x-tad-smaller><x-tad-smaller> 20
</x-tad-smaller><x-tad-smaller>end</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>end</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>end</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller>
</x-tad-smaller><x-tad-smaller>end</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller>
</x-tad-smaller>
This of course assumes that "Aachen" is the full name of the font, and "Bold" is just the style you want to apply to the font... For example, it might be an applied font of "Arial Narrow" and a font style of "Italic"...
And you should only indicate styles that are available for your font... you shouldn't, for example, specify the "Bold Condensed" font style for an Arial applied font, because Arial doesn't have that font style in its file; it only has "Bold".
(At the application level, you could set them all at once, like you are trying to do now at the text frame level:
<x-tad-smaller>tell</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>application</x-tad-smaller><x-tad-smaller> "InDesign CS"
</x-tad-smaller><x-tad-smaller>set</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>applied font</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>of</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>text</x-tad-smaller><x-tad-smaller> 1 </x-tad-smaller><x-tad-smaller>of</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>text frame</x-tad-smaller><x-tad-smaller> 1 </x-tad-smaller><x-tad-smaller>of</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>active document</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>to</x-tad-smaller><x-tad-smaller> "Aachen Bold" --</x-tad-smaller> spaced with a single tab character<x-tad-smaller>
</x-tad-smaller><x-tad-smaller>end</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>tell</x-tad-smaller>
)
Hope that makes the difference a little more clear...
Courtney
On Nov 17, 2004, at 2:15 PM, Rudy Gelderblom wrote:
I am trying the suggestions I got through the mailing list. I had actually
searched the Adobe site for relevant info, but didn't come up with
anything useful.
snippet of the code is as follows:
tell application "InDesign CS"
tell document 1
tell text frame 1
set applied paragraph style of every text to "Center" -- paragraph
style used in document
set applied font of every text to ("Aachen-Bold")
set point size of every text to 20
end tell
end tell
end tell
This particular example actually works. The same snippet with
"AGaramond-Semibolditalic" inserted does not. I have tried to set the
applied font using properties of the paragraph in question and I have
tried "paragraph" as well as "text", but no consistent results. Some fonts
work and some don't. My impression is that those fonts with multiple
styles tend not to work. PS, TT or OTF doesn't seem to matter Always
InDesign thinks the font is unavailable.
I am just trying to loop through our font collection and add samples to a
FileMaker database so I can group them in categories and print them (the
export as EPS and import into FileMaker works just fine). There is other
ways to do this. I am just ticked I cannot get this to work, so now I
cannot keave it alone :(
Thanks for the suggestions.
_______________________
Courtney Schwartz
Documentation Specialist
Global Technology Associates
3505 Lake Lynda Dr. Suite 109
Orlando, FL 32817 USA
(407) 380-0220 x1427
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden