Copy link to clipboard
Copied
Just getting started with scripting. Wrote a small VBScript to place a photo's file name as a caption, but cannot set the desired font. The caption's position and wording appear, but it's always in the current PS5 default font, and no error message appears.
Guessing that I'm not referencing a correct object/property/method, but don't see the problem. Script is not available just now, or I'd include - will post again with the script if that's what's needed for some assistance. Thanks!
Copy link to clipboard
Copied
If VB is like javascript you have to use the font's postscript name. Which in most cases is not the same as the name displayed in Photoshop. For example on my system 'Arial Regular' requires 'ArialMT'
Copy link to clipboard
Copied
Thanks, Michael - that did the trick. How do I find the PostScript name for
any font named in Photoshop?
Copy link to clipboard
Copied
I wrote a script, for CS2 or later, which lets you obtain the PostScript name of a font according to family and style (using pop-up menus similar to the ones found in the character palette). The script, named "Get Font PostScript Name", is part of the JSON Sample Scripts and requires the JSON Action Manager library. It has been successfully tested in CS4 on Mac OS X, but should be platform agnostic.
HTH
Copy link to clipboard
Copied
Thanks for the scripts, but I was unable to install the Action Manager, and
could not determine what mistake I was making. Since then, have had
success typing in Word some text in desired font, saving as a PDF, and then
finding the PostScript name from Properties. That will at least help me
until I solve my problem with your script.
Copy link to clipboard
Copied
Thanks for your feedback.
I prepared a stand-alone version of the script which doesn't require including files from the JSON Action Manager library: Get-Font-PostScript-Name-SA.js.zip
Once unzipped, move the script to Presets>Scripts inside your Photoshop CS5 folder; after (re)starting the application, the script should be available from the File>Automate menu, and display an interactive dialog (from which you can copy the PostScript name of the selected font from the text field):

Please let me know if you have any problem...
Copy link to clipboard
Copied
Thanks, Mikaeru69-it works beautifully!
Copy link to clipboard
Copied
From looking at the VBScript guide you should be able to find the postscript name of a font using VB. The Application object has a property called Fonts which contains a collection of TextFont objects. One the the properties of TextFont is PostScriptName. So if it is available to VBScript I would think that it is also available to VB.Net or whatever flavor you are using.
Copy link to clipboard
Copied
Thanks, Michael, for another approach. I have VB 2008 installed, and will
try it.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more