But, if you have bunch of links, you need to sort them first, select just embedded ones and then click Unembed Link from Links panel menu, or from context menu. But, it can be done much more easily with help of short script! Let’s see how!
When building complex scripts with lot of options that user can choose, it’s always great to allow user to also save selected settings and reuse them on next launch. We already discussed about this topic in earlier post [Saving script data within document] but I recently found better way for serializing and storing data.
In first post, I used simple “*” to separate multiple values, and at load time used split(*) to separate values back to Array. That’s not bad, and it’s working fine, but there is another much more elegant solution!
I created short sample to demonstrate usage and shortly explain how it works. Of course, you can extend it as you wish! So, let’s get started!
Counting words and also paragraphs, stories, characters is something pretty easy to achieve, but very often done in wrong way. Most of the time, people are looping through stories, text frames, paragraphs and adding word count. That is OK, for short documents, with short stories, but as document length increases, script needs more and more time to loop through all stories, and get all words. People are forgetting about awesome method called everyItem! Method remained undocumented until InDesign CS3, but scripting experts such as Dave Saunders had already pointed out its forcefulness and already knew how to exploit it. It allows us to get all elements within collection. For more info about everyItem method be sure to check two awesome articles by Marc Autret: On ‘everyItem()’ – Part 1 and On ‘everyItem()’ – Part 2. So, let’s take a look how everyItem method can help us count stuff.
After long time here comes new post about InDesign scripting!
This one is really cool and handy. Simply select files and script will load them directly into PlaceGun tool! Really simple and handy! Also there are some options that you can set while loading files into PlaceGun, but we will just focus on simple loading. One more thing. InDesign CS5 DOM introduced new class that is directly connected to PlaceGun. It has some more options like: abortPlaceGun and rotate among others. So, let’s get started!
Few days ago on Adobe’s InDesign Scripting forum I found question about duplicating all anchored and inline objects to another layer. It’s quite simple task, and all we have to do, is to get all page items, and check item parent. If parent is Character, then it’s anchored/inline object. So, let’s take a look!
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!
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.
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.
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.
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.
There is good way to store data within document elements. We can store very long text data into almost every element within InDesign. Data is only visible through scripting, and also can be set just through scripting. This is great way to carry document specific data everywhere we go, because data we set is saved into document. So, let’s see how we can use this great feature.
Are you frustrated with lack of History palette in InDesign? Did you know that you can retrieve undo/redo commands from script? Yeah! That’s right! It’s really easy to achieve History palette functionality with some easy script. I created really simple dialog with two drop-down boxes and undo/redo buttons. Let’s first how to get list of undo/redo commands that we have available.
For many years I worked just with CorelDRAW and one thing I really liked and I used to was changing cursor key keyboard increment. Unfortunately InDesign doesn’t allow me to change that setting, without going into Preferences. So, I decided to try to create script, with simple dialog box where I can input number, and change setting. This was my very first InDesign script
Here is short script for selecting multiple rows in table. This will create ‘visible’ selection. This script is also published on Adobe’s InDesign scripting forum but I found some parts on other sites too.
This is very great and handy script! If you have lot of text or numbers, regular alert dialog just roll text out of the screen, and you can’t see them. Here is an example from “ScriptUI for Dummies”, which is a more useful version of alert: it shows text in a scrollable window. An additional advantage is that you can copy text out of the alert. This was posted on Adobe’s InDesign scripting forum.
This is short one, but I use it in some of my scripts. Sometimes, script just hangs, or crashes, and if we used windows in script, they are not destroyed! They are still in memory and they will be there until we close InDesign. But, there is way to destroy all dialogs that are left in memory.
Few weeks ago someone asked on Adobe’s InDesign scripting forum how to change ‘greek below’ settings through script, and I want to share it here also. This time, it’s my snippet As you probably know there are three ‘Display performance’ settings and ‘greek below’ can be set separately for each ‘Display performance’ settings.