New to scripting in Indesign…
Is there a quick easy way to know what the exact font name is within Indesign…
For example, I tried using “Helvetica”, but mine must be actually a slightly different name, such as 65 Helvetica Roman…
I know the coding works, because I was able to switch my typeface to Verdana without problems.
Also… interestingly when I used the code:
try
--Enter the name of a font on your system, if necessary.
set myFont to font "Helvetica"
on error
display dialog "Font Not Found"
end try
I didn’t get an error… and when I used the code:
try
set applied font to myFont
end try
My font stayed in Times, and didn’t change to Helvetica.
Thanks again.
David
If you just want to check the names of the active fonts, try:
tell application "Indesign cs" to return fonts
thanks… that works.
Here’s a related question. When I use that code, I do get my whole list of fonts. It seems that Indesign sees the family name and then inserts a tab character and then has the style name. So for example, I have the font: Friz Quadrata Medium listed in Indesign. Does anyone know more about this?
thanks
david
You have to put the tab in when you specify the font. Here is an example from CS3. I am not sure if the syntax is exactly the same going back to CS2 or CS…
tell application "Adobe InDesign CS3"
tell active document
set NewTextBox to make text frame with properties {item layer:"Default", geometric bounds:{1.0, 3.0, 2.0, 4.5}, contents:"Testing"}
set properties of (every text of NewTextBox) to {applied font:("Helvetica" & tab & "Bold"), point size:5.0, leading:6.0, justification:right align}
end tell
end tell
Model: G5 OSX 10.4.8
Browser: Safari 419.3
Operating System: Mac OS X (10.4)