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!
I just want to thank you all who visited my blog!
I hope you find it good and useful in your work with InDesign Scripting! THANKS!
Few days ago on Adobe’s InDesign scripting forum I found question how to create custom menu to insert predefined text items into ScriptUI text box. I started to research and found really easy and good way you achieve this handy “menu”. All we need is dropdown and short script for controlling insert behavior.
Well, this is almost ‘Most Wanted’ snippet around Have you ever wanted user to prevent executing some menu item? I did, but I didn’t had answer how to do it. There is no way to disable menu item, but what we can do is to cancel executing it. What we are going to do is to add event to ‘menuActions’. So, let’s take a look.
Have you ever wanted to add a dropdown/listbox item but with icon beside? This is not really possible with native InDesign dialog manager, but it can be done with ScriptUI! It’s really easy to achieve this great little feature. So, let’s take a short look how to do this.
In previous post about Extracting Metadata with Adobe XMP we were extracting complete Metadata from file and saving it to XML file. In this post we will take a look how to extract just those elements that we want. Also, don’t forget to grab Adobe XMP Specification and visit Adobe XMP Develop Center for additional info about XMP Specifications. Before continuing I suggest you to extract Metadata from file to XML or you can find same structure in ‘Links panel -> (Right click on image link) -> XMP File Info -> Raw Data (tab)’. It will be easier to understand and find data that we want to extract. So, let’s get started.
Almost every media file contains info about it’s contents. Adobe’s XMP (Extensible Metadata Platform) is, as they say, “a labeling technology that allows you to embed data about a file, known as metadata, into the file itself”. Devices like digital camera’s, camcorders, mobile phones also save metadata, and we are able to retrieve that info later. “Various standards initiatives are using XMP as their framework of choice for implementation”. More info can be found here: Industry standards groups powered by XMP. So, let’s see how to grab all saved data from file with really simple code.
Did you know that you can change active tool through scripting? YES, YOU CAN, and it’s so easy! This is new option in InDesign CS5 scripting, and it’s so cool! You can even retrieve current tool name, hint, icon file! It’s really great feature! So, let’s look how to do it!
Great InDesign feature is that we can fill empty text box with ‘Placeholder text’. That’s very handy when we have to create template, but we don’t have text. There are few scripts for InDesign that allow us to insert different types of text, but this is my favorite: Change placeholder text by luxlucid. Also, there is very good website for creating placeholder text: Dummy Text Generator! So, let’s get started!
Well, this one is really awesome! I was playing with finding positions of selected text, baseline and stuff, and I came to great idea! What if I want to draw polygon around selected text? Can it be done through scripting?! Well, I tried, and I think I was successful! It’s little bit complicated, but I learned a lot! So, let’s get started!
If we want to extract clipping path from InDesign GUI we simply go to Object -> Clipping Path -> Covert Clipping Path to Frame, but how to do it through scripting? Another thing is that we can’t convert multiple selected images with clipping path to frames through GUI, but you can do it through script. I will cover just converting one selected frame, but we can loop through selection and do same to every image.
I think that title already says everything about this post and I’ll try to be short. When you are exporting from InDesign GUI you have option to export just selected objects, but how to achieve this from script? This script is also published on Adobe’s InDesign scripting forum.
There are few useful properties you maybe want to use when copy/paste objects and text in InDesign. You can change them through preferences, but also through scripting.
Like you probably know, InDesign can move/duplicate pages within document through scripting, but you can also move/duplicate pages between documents! I found this snippet on Adobe’s InDesign scripting forum, and I tested it and it works just fine!
Few days ago, on Adobe’s InDesign scripting forum I found something very interesting. It was great little function for number conversion from Decimal to Roman numbers. But it wasn’t I enough so I tried to reverse functionality. Functions are converted to ‘prototypes’ for easier usage.
Two days ago on Adobe’s InDesign scripting forum I found interesting question about creating custom menu, so I decided to dig little deeper and see how to achieve desired effect. I went to Marc Autrets site, and post How to Create your Own InDesign Menus. I tried to create custom menu that will be inserted into InDesign’s main menu, with three menu items, and one separator.
We are going to look at simple way to get all text variables. Important thing is that InDesign had two different lists of text variables. One list is stored in ‘app’ object, and another is in ‘document’ object. This is very important to remember! Part of this script was published on Adobe’s InDesign scripting forum by Peter Kahrel. So, let’s get started.
Few months ago on Adobe’s InDesign scripting forum question was asked about getting all font styles from selected font. I want to share my way for doing this. It involves two prototype Array functions, and nothing else. For this example I created small window for selecting font family. So, let’s get started.
I’ve made small simple script for exporting document to PDF using preset we select. We will see how to list PDF Export Presets we have available, select output file, and export file. So, let’s get started!
Sometimes we want to have full day/month name instead of just numbers. Here is really short little snippet to achieve this result. This post also can be found on Adobe’s InDesign scripting forum.