Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Setting PS5 Fonts with a VBScript

New Here ,
Oct 27, 2011 Oct 27, 2011

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!

TOPICS
Actions and scripting
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Mentor ,
Oct 27, 2011 Oct 27, 2011

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'

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2011 Oct 29, 2011

Thanks, Michael - that did the trick. How do I find the PostScript name for

any font named in Photoshop?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 29, 2011 Oct 29, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2011 Oct 30, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 31, 2011 Oct 31, 2011

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):

Capture d’écran 2011-10-31 à 11.27.32.png

Please let me know if you have any problem...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 31, 2011 Oct 31, 2011

Thanks, Mikaeru69-it works beautifully!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 31, 2011 Oct 31, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 31, 2011 Oct 31, 2011
LATEST

Thanks, Michael, for another approach. I have VB 2008 installed, and will

try it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines