Archive

Archive for December, 2010

Saving Script Data using JSON [Part 2]

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!

What is JSON? JSON (JavaScript Object Notation) is a lightweight data-interchange format in other words it’s Associative array. It is, among other things, a faster, simpler, easier-to-use alternative to XML. More info about JSON can be found here: Introducing JSON. That’s great, but how to use it in InDesign?! How to save/load values?

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! :D

Read more…

QuickTip: Find Object Properties Quickly

Finding properties in OMV (Object Model Viewer) can be really painful, and slow. Personally, my best friend when writing scripts is Theunis de Jongs (aka Jongware) InDesign JavaScript Reference Guide but also trying to remember connections between objects and when to use which property, class, method… But, there is also another way to find out what properties you can use, and it’s already built in. Key is in Object reflection! So, let’s take a look how to put it in use! :)

Read more…

QuickTip: Counting Text using everyItem()

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. :)

Read more…

ANN: Happy Holidays!

Categories: General info, News!

QuickTip: Preparing for ACE Exam

Hey people! How are you?! :D

As you probably noticed, I’m not posting that much on blog last month or two. One of the reasons is that I’m preparing to take Adobe Certified Expert (ACE) exam, so I’m studying hard! First thing I asked myself is how to prepare for exam, what I have to know? Well, if I want to have that last letter E (expert) than I have to know all about InDesign, to have it in my little finger :D

Read more…

Follow

Get every new post delivered to your Inbox.

Join 36 other followers