A few days on Adobe’s InDesign Scripting forum I found question about inserting info into XMP InDesign file info. Also, mission was to find text formatted into specific paragraph style, and insert found content into XMP’s ‘Document Title’. Easiest way to achieve this is to use ‘Find’ and search for paragraph style. But, I also wanted to insert some more info into XMP like keywords or author, through scripting. So, I created document with some text from Adobe InDesign Features page, created two paragraph styles for Title and Author, and character style for keywords. So I formatted title and author with paragraph styles, and also I ran through text and formatted some words with ‘Keyword’ character style. So, let’s see how it works! 🙂
Some of Adobe file format’s (INDD, PDF, AI) are using Metadata to store low-res preview of file inside file itself. For example InDesign allows you to select how many pages do you want to include in these previews and also preview size/quality. We have to keep in mind that data is not stored in binary format. It’s stored in, so called, Base64 encoding scheme, that represent binary data in an ASCII string format. So, in addition to extracting data we have to decode it to binary, and then save it to file. So, let’s get started! 🙂
How to check if a number is even or odd? We can use Modulus operator (%), which returns the remainder of a division operation. If you divide some number by two, a remainder of 0 indicates an even number, while a remainder of 1 indicates an odd number. Best and easiest way is to create ‘Number’ prototype.
Do you want to import styles from other document through scripting? It’s really easy to achieve, and you also have control about overwriting styles with same name. Also, you can import all kind of styles, you are not limited to just Paragraph or Character styles. We will take a look to the style ‘importStyles()’, but I also prepared short example how to implement it in dialog. Also, keep in mint that we can import to the document or to the application. So, let’s get started! 🙂
Does this image looks familiar?! Do you want to change missing font through scripting? Then I have good news for you, it can be done really fast and easy! We are going to look easiest way for retrieving missing fonts from document, and also I will share this script integrated into dialog and font selector. This idea came up to me yesterday while I was studying ‘BeforePrint.jsx’ from Scripting guide that you can download from Adobe InDesgin scripting page. Also, Marc Autret posted script on Adobe’s InDesign Scripting forum for changing missing fonts inside styles, so be sure you check it! So, let’s get started! 🙂