Replace document fonts in InDesign CS6, js

Hi,
I need to replace document fonts in InDesign. I get the existing fonts with following script, but not sure how to replace let's say Helvetica Regular with Aria Regular:
for(var counter = 0; counter < document.fonts.length; counter++){
            //If the <fontFamily> element for this font family does not already exist in the XML, add it.
            if(counter > 0){
fontFamilyName = document.fonts.item(counter).fontFamily;
                    fontFamilyName.toString().replace(/\s*\(TT\)$/gi, "");
                    alert (fontFamilyName);
                    fontName = document.fonts.item(counter).name;
            alert (fontName);
            fontName = fontName.split("\t");
            fontStyle = fontName[1];
            if(fontStyle == "BoldBold"){
                fontStyle = "Bold";
            fontName = fontName[0];
            alert (fontName);
Thank you.
Yulia

Yuliart please mark as correct
Virender,
I didn't put in the font style because it wasn't asked for but if you are finding both the font and the style as in your example then you don't need to do a separate line for the style
Just use
app.findTextPreferences.appliedFont = "Arial\tRegular";
I.e. the font name seperate from its style by a tab \t
You only need to use a separate line fontStyle if you are looking for that style irrespective of which font the style is applied to although some might argue to use it for readability.
Regards
Trevor

Similar Messages

  • Replace fonts in InDesign CS6, js

    Hi,
    is it possible to replace document fonts on document level instead of going through every text object in the document? Let's say Times with Times New Roman.
    Thank you.

    Hi,
    I also use this script but with additional information.
    var mydoc = app.activeDocument;
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    // find here
    app.findTextPreferences.appliedFont = "Arial";
    app.findTextPreferences.fontStyle = "Regular"   // this is additional
    // change here
    app.changeTextPreferences.appliedFont  = "Frutiger";
    app.changeTextPreferences.fontStyle  = "45 Light";
    mydoc.changeText();
    Virender
    PS: I could able to write this script with help of:
    Jump_over (Jarek)
    Laubender (Uwe)
    Yogesh (my colleague)

  • Bengali Unicode fonts in InDesign CS6

    Dear InDesign Gurus,
    How do I type using "Bengali" (Unicode) fonts in InDesign CS6?  I've tried to copy/paste the text from an existing word document on to an InDesign document, but it shows up with square blocks!   I'm using Windows 7 Pro 64Bit OS.
    Is this even possible?  Would someone please provide me some detail steps?
    Many thanks in advance.
    Simon

    Cyndee,
    As I said, I'm fairly new in ID, would you kindly tell me the steps so that I know what to do?
    Ellis,
    I am working with a ID Magazine template.  Obviously the template has blocks and pre-written text inside those blocks.  If I try to delete the text (without deleting the BOX + contents within) and paste the Bengali text from some other document, some of the characters do not stay in place.  Whereas, if I just create a text box and paste the text inside the new box, texts show properly. 
    So my question to you Gurus is... how can keep the template I'm using and just replace the text within text box and save time.   Would someone plz guide me?
    Thanks for your professional help!

  • Arabic fonts in InDesign CS6

    I¹m looking for some help regarding Arabic fonts on Mac InDesign CS6 (Adobe Creative Suite 5.5).
    I¹ve designed a company profile in English and they need it to be translated into Arabic for their Middle Eastern branch. They¹ve sent the correct Arabic copy in a Word document but the moment I copy it into InDesign it corrupts and becomes illegible. I¹ve looked on the Adobe and Apple forums but can¹t find a solution for the problem.
    This is a Mac problem because one of my friends have InDesign for Windows and the font works 100% on her version. I think the problem is that the Arabic font was written for Windows and is therefore not compatible with Mac.

    This is a Mac problem because one of my friends have InDesign for Windows and the font works 100% on her version.
    Mmmmaybe.
    Can you tell us the name of the font?  In which version of Word is the Arabic rendering correctly? Do you have a known-good PDF to compare your Arabic against? If not, how do you know that the Arabic is rendering correctly anywhere?
    It was my understanding that Mac Word simply can't handle right-to-left scripts like Arabic, so it's possible that your translation provider has used a very old font that fakes the cursive connections between letters in Arabic. It could also be the case that the font is Arial - versions of Arial installed with Office for Mac traditionally don't have Arabic glyphs because Mac Office has not offered RTL support for Arabic. But the font technologies used in Windows for Arabic support (both in TrueType and OpenType) do, in fact, work on the Mac, assuming the font was made by someone who knew what they were doing.
    Both Peter and shnath offer good advice. I am a big proponent of World Tools, but in CS6 if you have a correctly formatted Word document you should be able to just place it and get RTL behaviors, if the font used has Arabic support.
    Lastly:
    I¹ve designed a company profile in English and they need it to be translated into Arabic for their Middle Eastern branch.
    I don't do much commercial work myself (I'm more of a nonprofit, social-service guy) but a "company profile" sounds to me like something that should be typeset by a graphic designer who actually reads the language. You are working on some kind of marketing or business speech intended for distribution in a culture where good calligraphy and typography are very important. It is unfortunately very easy for those of us who are not immersed in these calligraphic traditions to accidentally do something equivalent to formatting a press release in sixteen-point Comic Sans. So if you keep posting in this thread we can get you to the point where your Arabic copy is legible, and probably to the point where it's not embarassing. But if your clients need anything more than basic legibility, you may want to hand this off to someone who is an in-language professional.

  • Hebrew Fonts Mac Indesign CS6

    Hey there!
    I'm having problems with my Hebrew fonts and need help. I have Indesign CS6 for Mac and have downloaded the Hebrew Supported version. I have set up my document so that paragraph and character reflect the need for Hebrew. I can use the standard Hebrew system fonts, however I have loads of great Hebrew fonts which are recognised by Font Book but not in Indesign. The weird thing is that on CS4 these fonts were recognised (however at that time I didn't have Hebrew support so ended up typing, letter for letter, backwards to get the text I needed.
    Can you give me some indication as to why I am unable to use these fonts? When I try to use them I get this warning:

    The warning sounds like it indicates that the font you want to use might not be suitable for Unicode Hebrew.  Are they perhaps in some legacy encoding?
    In any case, you should also search/ask in the forums devoted entirely to the problems of Adobe products, if you have not done so already:
    http://forums.adobe.com/index.jspa

  • Fonts in Indesign CS6

    I have recently downloaded the new Indesign CS6 and now my fonts are showing up as an error. I've tried copying all my fonts and adding them to the Indesign folder but they are still showing as an error. Please help.

    Please show me a screen capture of the error (inthe Prefilight panel, which is where I think you see it) and on the page when you click the link nect to the error listing. You can embed the screen captures in your post using the camera icon on the web page, like this:

  • Font Problems InDesign CS6

    Hello
    The new version Adobe InDesign CS6 of the program does not work when some Arabic fonts, one of the final family axt
    And many others, what is to solve this problem
    http://im24.gulfup.com/2012-05-22/1337673524451.png
    Lines do not work at all
    When switching the font of the same family, it does not happen often tried something, but I did not know why.
    Please help solve the problem

    مرحبا وليد
    بعد ورود عدة شكاوى بخصوص خطوط اي اكس تي، تواصلنا مع فريق التعريب لدى ادوبي وابلغونا رسميا بعدم توافق برامج سي اس ٦ مع هذه الخطوط  ويبدو ان بعض هذه الخطوط تعمل بشكل جيد وبعضها غير متوافق تماما والبعض غير متوافق كليا، لذا من الواضح ان الخيار الافضل هو تحويل الخطوط لنمط اوبن تايب او شراء خطوط اوبن تايب لتلافي المشاكل بالمستقبل
    Hi Walid,
    After recieving numerous complaints from ME Adobe users regarding AXT fonts, I received an official response from concerned team that Adobe CS6 products doesn't support AXT fonts. Having said that, you may find some of these fonts will run alright, some will have little problems and some will not display at all (as in your case). Best option is to convert AXT fonts to OpenType, or purchase OpenType fonts first hand.

  • Change menu display font in Indesign cs6?

    I recently got Adobe Creative Suite 6 and am having problems with InDesign. When I open the program and am prompted for file size etc... the display font is Harrington (or something curly like that). The same goes for the stroke menu and font menu. Is there a way to change this display/default font?

    My question isn't about how to change the default font when using the text tool but how to change the display fonts for all menus. In the picture posted before I was showing you the drop down menus to point out the Harrington font used. In previous versions of Indesign that font was something basic and easy to read like Arial or Helvetica.
    Picture 1 is of Illustrator CS6. The font for space where I enter information (ex. Name : Untitled-1 ... Number of Artboards: 1 etc.) is a Arial but in Picture 2 the same fields are in Harrington - is there a way to change this to be like picture one?

  • Font families consolidated in Mac OS X Font Book, but expanded into multiple fonts in InDesign CS6

    I have an OpenType font installed on my system that appears in Mac OS X's Font Book as 5 fonts (regular, condensed, etc.). Within each of those fonts are the many bold and italic style variations, shown just as I want them. However, InDesign shows these fonts as dozens of different font families, and no more than 4 style variations for some of those families. How can I tell InDesign to consolidate this font into only 1 (or 5) font families?

    It all depends on how the font designer created the font family.
    Exactly which font family and which font vendor/creator are you talking about?

  • Scroll live through fonts in indesign cs6

    Is it possible to change a selected piece of text with a font while clicking through the font character menu. I would love a more fluid way to view font types on a block of text until a preferred font has been chosen?
    rob

    You can't click, so far as I know, but I do this all the time:
    1) Select your text with the text tool
    2) Select the font-name in the font dropdown. Don't pull it down; you just want the font name highlighted.
    3) Use the up-arrow and down-arrow keys on your keyboard to scroll through the fonts

  • InDesign CS6 - fonts problems (Document fonts fight with system installed fonts, "font incomplete")

    hello
    First, Indesign function to automatically open fonts from "Document fonts" folder is fantastic, quasy font manager. BUT, fonts is available ONLY for THAT indesign document, no other application can use it, even from CS6 suite. This is probably the most stupid decision about how this function must work. IDEALLY, fonts will be available for ALL application inside CS package until indd doc is closed. If I need some font for editing links in photoshop, illustrator I need to install them. This workflow have wrong concept.
    We now have problem, sorry Indesign have problem. Example, I need type1 font mt-symbol for mathtype AND for Indesign. This font is installed in c:\windows\fonts folder. Everything work fine. When I make package from Indesign and reopen indesign indd document inside package, Indesign report that mt-symbol IS INCOMPLETE. WHY, BECAUSE CONCURENT FONTS from both C:\windows\fonts folder AND FROM "Document fonts" folder. If I rename "Document fonts" folder, Indesign open font only from system and everything work properly.
    THIS IS BIG PROBLEM, fonts circles around workflow/folders and always will be duplicates in "document fonts" and system\fonts folder because different application need same fonts.
    Any solution?

    Another problem with the Document Fonts folder that we just noticed: in CS5, you could place Windows Type 1 fonts (.pfm and .pfb) into the Document Fonts folder on a Mac and InDesign would activate them.
    This no longer works in CS6. (Bug report filed.)
    Huge bummer, as this was a great timesaver and workaround in a high-production prepress environment when working with old Windows files. Hopefully this was not an intentional change and will be restored in a later bugfix release, or at worst in CS7.

  • How Do I Mass Search and Replace Swatch Colors In Entire Indesign CS6 Document?

    I've jumped from CS4 to CS6 and its been a little while since, but just trying to refamiliarize myself with the many Features of Indesign CS6.
    Here's my issue: I have a really old CS4 document I've opened up and saved in CS6. I have to change all swatch colors throughout the document from pantone swatch 295 C to updated pantone swatch 293 C.
    Question, without my having to go through the entire document one object at a time looking for each object, HOW do i perform a Mass search and replace of Color swatch references from 295 C to 293C.
    I thought i could just click swatch properties and update the color... but No... that doesnt work as swatch properties is just grayed out
    I'm sure i've overlooked something but a refresher on how to mass find and replace color in a document would be great.
    Thanks and looking forward to hearing from someone.

    Thanks for the tips.... both seem like good options without my having to purchase a 3rd party software to accomplish this...
    I must admit... Because I've been stuck in Web Design and Motion Graphics for the past couple of years, when I re-opened my old print work from the CS4 days into CS6 it is obvious I have some catch up to do....
    I was almost embarrassed to admit I had forgotten the technique of Alias one color to another using Ink Manager... I had to look it up and found this helpful tutorial http://indesignsecrets.com/alias-one-color-swatch-to-another.php
    Thanks for both solutions....

  • InDesign CS6 + Yosemite + Copy/Paste = Missing font

    We use ITC Franklin Gothic throughout all of our pieces; it's installed and it's the default font setup. New and existing files have opened without issue until now. I opened an advertisement that needed to be resized, from our shared server and copied the contents. In a new document, I pasted the contents suddenly the font says it's missing. The images retained their links to the packaged folder on the server, the fonts just stopped working. I closed InDesign, then disconnected from the server in case there was some kind of conflict between the local font and the server font override from the packaged fonts folder (packaged from the local font installed, I made the source ad this same way). Loaded the new file, and got the expected missing links dialogue, but unexpectedly the fonts were still missing. I reviewed the missing fonts, and it was the entire family. I opened Suitcase, verified the fonts are active. Still no fonts in InDesign. Okay, disactivated font in Suitcase (maybe it needs an update), installed the font in Fontbook, need to get the ad done and I don't have time for this. Verified font works by opening a different file, making a new document, but as soon as I opened the ad with the missing the fonts, fonts go missing. I then changed the fonts to a different family, and tried changing them back, but the font doesn't even show in the list of fonts. I can't figure out why this particular method of copy and paste breaks the font. I've opened and created other files with this font family active, while this copy/paste file is open at the same time in another tab while it still says "no". The only work around I could use was to copy the entire packaged folder from the server to my desktop and just change the document properties to the size I need, then adjust the artwork to fit.
    I'd like to find a resolution as to why copying and pasting broke this font even though the same missing font works fine simultaneously in a different document. Any suggestions/questions/thoughts/solutions would be very welcome.
    System specs:
    27" iMac (Mid-2011) 3.1 GHz i5
    32 GB RAM
    1 GB Video
    10.10.2
    Adobe InDesign CS6 8.1
    Update: Looking through the font list, Franklin is being listed as a different font. Though the character palette, the font selected is ITC Franklin Gothic Std Book; the font listed in the Type drop-down menu is Myriad Pro, and once that was deactivated, Helvetica.

    i don't see how that could be the case because I originally installed the font, created and packaged the ad, and the font is available for typesetting in a new document while this problematic document is open without being connected to the server.
    I upgraded to creative cloud 2014 and this particular document is still a problem. This font issue is limited to this sole document. I'm guessing it has something to do with the copy and pasting. Tomorrow, I'll try replacing the font to something else and then copy/pasting it in the same way if it recreates the same problem with a different font.

  • Font issues in InDesign CS6

    I downloaded InDesign CS6 through Creative Cloud and am having lots of font problems. If I use any font other than an Adobe font or an Open Type font, I am unable to create an error-free pdf from the InDesign file. I can use True Type or Type 1 fonts in the document, but they won't embed into the pdf file. What gives?

    Well, those fonts may simply not allow embedding. There is such a flag which font creators can set and Adobe apps honor this and do not embhed fonts they are not allowed to.... Anyway, ask in the ID forum and provide more details like what fonts you actualyl use, what system, what PDF settings and so on...
    Mylenium

  • How to replace multiple files in same location Indesign CS6

    Hi everyone please help me with this challenge if you are avialable it will be greatly appreciated!
    Ok I have a spread of about 60 pages in indesign.  I created a template where I have differnt PDFs in each section.  I have 3 different PDFs per page totalling about 180 different PDF docs in my in design file.  Every week I have to go in to replace those PDFs with the new ones.  They have to be in the exact same place and sized the same way since they are setup to print on one of our printers.  In indeesign CS3 I would just do Command D and then I would select all 180 PDF documents.  It would import all of them and I would just click on each area of the PDF holding down "Option" and it would automatically size the PDF to fit in the same way the previous PDF was.  Basically just replacing it.  I did this for all 180 relatively simple.  Now that feature is gone!  I can't for hte life of me figure out how to do this.  I've tried everything and it's not working.
    Can any one help me?

    Make Object style to your frames and setting the Frame Fitting Options>Fitting
    Also try: tomaxxiPlace2 script, i test it with indesign cs6 and it work fine.
    http://indisnip.wordpress.com/2011/01/13/script-tomaxxiplace2/#more-960

Maybe you are looking for