Home > InDesign Scripts > Number of objects in selection

Number of objects in selection

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.

var objSelected = app.selection;
alert(objSelected.length);

So, objSelected is filled with objects from selection, and we just display Array length in second line.

If we just want to display how many objects are selected, we can do it like this:

alert(app.selection.length);

So, it’s not big deal, it’s easy and fast!

Have fun! :D

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 34 other followers

%d bloggers like this: