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.
Yesterday we had example how to read IP/Gateway with help of VBscript. Todaw we will try to get Adapter info and MAC address. On some systems, I don’t know why, but adapters are duplicated, so you can later convert values to array, and delete unwanted ones.
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 :D
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.
Do you have lot of libraries? You need to open them but you are tired of searching right folder and stuff? This is simple and effective solution for opening libraries that are located in same folder. This script is published on Adobe’s InDesign scripting forum by me :) Also, you can build it in some bigger script/dialog.
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.
Guides are very good helpers when you work but sometimes we want to get rid of all guides. It’s easy when you have few pages, with one layer, but if you have 100+ pages, with hundreds of guides, it can become a pain to remove all of them.
This is one of things that I’m missing in InDesign! When you have selection, there is no way to see how many objects do you have selected! Even ‘Info Panel’ doesn’t show object count! But, there is easy way to achieve this with scripting. :D Of course you can use this in your script to loop through all selected objects for example.
Like I said in previous post, ‘Find colored words‘, we will create swatches selector. This is not my script, and I will credit author on the end of this post. You can find this post on Adobe’s InDesign scripting forum. So let’s get started.
Let’s say you have script and you need to create loop, but, loop count depends on special color word count. Here is little snippet for counting words in color of your choice.
In-Tools just released very cool FREE scripting panel for entire Creative Suite 5! You can do much more that with built-in script panel for InDesign, and also you get scripting panels for Photoshop and Illustrator! So, hurry to http://bit.ly/9soSN2 and try it today!
This is not my script, but I find it really handy! It searches through all links in document and finds just embedded links and push them into Array.
Like we did searching through paragraph style names, in this little snippet we will search through links file names.
Moving, scaling, rotating group of objects is always easier. InDesign CS5 is much better with editing grouped objects. Even with scripting, if you want to rotate 4 selected frames, you have to go through loop and rotate each of them, but not if objects are grouped! Let’s see how to group selected or all objects on current page or layer.
Well, here is something very handy. With this script you can search through your paragraph style names.
First, let’s clear how InDesign is working with selections. Selections are always in Arrays. So, first object in Array has index 0, second object is 1, and so on. For now, we are going to take a look just how to rotate a single object.
Well, for beginning, here is short and simple script to zoom page. There are a few approaches to selecting page, but for this I will use simplest method.
I’m a Graphic Designer/Prepress and Imposition operator from Subotica/Serbia. My everyday work includes working with Photoshop, Illustrator, InDesign, CorelDRAW. I recently started to write scripts to speedup my work with InDesign. Please excuse me for my sometimes bad English, my mother language is Serbian :D
So, here you will able to find short scripting snippets that are useful, and can be used in bigger scripts for InDesign. Some of these snippets will not be mine, so I will credit real author. Most of this snippets can be found on Adobe’s InDesign Scripting forum, but sometimes, when you need something specific it’s really hard to find it there.
All snippets will be labeled with InDesign version and I will try to test every snippet I post.
Snippets will be kept shortest and simplest as possible, and if necessary, with short explanation and/or code breakdown.
If you have some snippet, suggestion, maybe question, feel free to contact me, and I’ll try to answer you.
Marijan Tompa (tomaxxi)