Re: Fonts in InDesign CS
Re: Fonts in InDesign CS
- Subject: Re: Fonts in InDesign CS
- From: Courtney Schwartz <email@hidden>
- Date: Tue, 16 Nov 2004 13:00:07 -0500
Last spamming, I promise... :)
This code shows that depending on *where* in your code you set the font and style, you may have to use different methods to set it.
The tab-delimited method doesn't seem to work within the tell blocks of the second method, for example -- it'll highlight it as a substituted font (as you described your problem) if you have that highlighting turned on, because it will try to put the style in the font family box where it doesn't belong. The tab-delimited method only seems to work if you use it from the application level, which is also, BTW, where you set the text defaults, which also require the tab-delimited method...
That's why I mentioned that you should send a code sample... The answer depends on what scope you access it with.
<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>First method.<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>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> "Trajan</x-tad-smaller> <x-tad-smaller>Bold" --</x-tad-smaller>There is supposed to be a tab character between these words, and nothing else.<x-tad-smaller>
--</x-tad-smaller>Second method.<x-tad-smaller>
</x-tad-smaller><x-tad-smaller>tell</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>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>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>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> "Trajan"
</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>end</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>tell</x-tad-smaller><x-tad-smaller> --</x-tad-smaller>text 1 of text frame 1<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>active document<x-tad-smaller>
--</x-tad-smaller>And of course setting the font is generally not as good as making and setting a style using "set applied character style" or "set applied paragraph style".<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>application "InDesign CS"
BTW, you might also have luck searching the Adobe InDesign scripting forums for that kind of information... This list is more directed at general AppleScript, whereas scripting InDesign is the focus in that forum...
Courtney Schwartz
On Nov 16, 2004, at 12:23 PM, Courtney Schwartz wrote:
One more thought: did you separate applied font and font style attributes? For example, try setting the applied font to Trajan, but the font style to bold.
On Nov 16, 2004, at 12:12 PM, Courtney Schwartz wrote:
Could you post the specific code you're working with?
I'll also make this remark: are you separating it with a tab and putting the second part in proper capitalization, as in "Arial Bold"?
On Nov 16, 2004, at 11:00 AM, Rudy Gelderblom wrote:
Does anyone have any success with using Applescript to set fonts in Indesign CS? I have the names of fonts available in my system, but InDesign doesn't seem to like the format for the name. I have, say, "Trajan bold", but if I set the applied font of some text to "Trajan bold", InDesign doesn't recognize it. If you get the status of the font you are trying to use, InDesign returns "unavailable". InDesign is clever enough to figure out what font styles are available for any give font, but cannot cope with the "native" name of the font. Even using just the family name of a font and then trying to set the style with AppleScript has not been successfull (somehow I would have to derive all the styles available for a font I wanted to use). Any clues appreciated.
cheers
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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