Skip to main content
July 17, 2009
Question

VBScript editor with Intellisense/Code Hinting support for Adobe App

  • July 17, 2009
  • 4 replies
  • 7371 views

I am looking for some tool to write my InDesign VBScript files in. I would really like to know if there is any which support Intellisense/Code hinting for Adobe programs (InDesign especialy). Do you have anything to recommend?

I am quite good at hacking my computer, so no registry change etc. is a problem for me, I just can not find any. I already tried PrimalScript 2009 but it doesn not work.

What I need is that in following block of code

Set myInDesign = CreateObject("InDesign.Application.CS4")

Set myDialog = myInDesign.Dialogs.Add

I will get list of all methods/properties after I write the dot after "myInDesign" in second line. But it never worked. I even tried to put "InDesign.Application.CS4/C:\ProgramData\Adobe\InDesign\Version 6.0\cs_CZ\Scripting Support\6.0\Resources for Visual Basic.tlb" line into Options>Text editor>Type libraries.

I am using Windows Vista SP1 and I have Adobe Creative Suite CS4 installed (upgrade from CS3 which was upgraded from CS2)

Thanks a lot for any help/suggestion, as I start feeling desperate.

This topic has been closed for replies.

4 replies

Participant
September 28, 2009

For me, the best one is definitely Vbsedit

It has intellisense, debugger, tons of samples and it is very simple to use.

You don't have to pay anything if you don't use the debugger

September 28, 2009

Hi John_Clayton,

I also like VBSEdit a lot, but my version (3.3.9) can't add a reference to the InDesign model, and so can't get intellisense for InDesign scripting terms. Has this changed in newer versions?

Thanks,

Ole

Participant
September 2, 2009

I'm happy with ExeScript Pro VBScript Editor. It has a number of useful functions, allowing to edit, compile and debug scripts, as well as search and apply COM objects. Also it can convert your script into exe file. The price is $99

Kasyan Servetsky
Legend
July 18, 2009

Hi Matus,

I use Microsoft Visual Basic 6 to write VB scripts.

To get code hints:

  1. Add the reference to InDesign (Project > References > select Adobe InDesign CS4 Type Library)
  2. Declare (that is, Dim) variables:

Dim myInDesign As InDesign.Application
Dim MyDoc As InDesign.Document
Set myInDesign = CreateObject("InDesign.Application.CS3")
Set MyDoc = myInDesign.ActiveDocument

Now when you type myInDesign. , code hint will appear.

You can also use Object Browser to see all InDesign objects, their properties and methods (Choose InDesign library in the top left corner).

After you finish writing a script, remove all Dims, as it can lead to some errors.

Kasyan

July 18, 2009

Hi Kasyan,

thank you very much for your advice. I assume you start a Visual Basic project, then open Visual Basic file (as you use a VB syntax for Dim).

1) There is a bit of overhead, but it is certainly worth the time. I need to declare every object variable using Dim, but as I can put all such declaration at the top of the file, I can easily remove it later.

2) I got Visual Studio to try it, and it keep removing the 'Set' statement, as it stick with Visual Basic (not VBScript) syntax.Only way around for me is to wirite it down later manualy. I thought about having them inserted by some kind of search and replace script, but coments in VB and VBScript all always spanning to the end of line, so all i can do here is make comments so i can quickly find all place which I need to edit. (Or I can replace each such comment and a new line with "Set " automaticaly)

Otherwise then that, it works as required.

If there is no better solution found, I will stick with this one.

But I still hope that I am not the only one writing VBScript code for Adobe apps looking for some code hinting and there is some elegant solution to the problem. If not, what the hack, it is not the first time I am scraching my left ear with my right hand ;-)

Matus

July 24, 2009

I contacted also Sapien support (producer of PrimalScript) and submited the typelib.

Problem and solution according to Sapien:

The (Adobe InDesign CS3) typelib is missing a flag on the component definition, which prevents it from loading and assigning this correctly. It's a simple thing to prevent from our side though as you can see below. This will be included in the next service build (Usually first tuesday of a month).


Link for Sapien support thread with working screenshot: http://support.sapien.com/forum/forum_posts.asp?TID=1234

So I will wait till next service release adn confirm it is working and then close this thread.

Matus

Jongware
Community Expert
Community Expert
July 17, 2009

When I need cross-application stuff, I start up Word and use its VBA editor. With some addition of, what are they, TLBs? it uses its built-in support for Intellisense and class and property help lookup. Works like a dream -- fortunately, as I'm not that VB savvy.

July 17, 2009

Thank you for your advice. I already tried it before (and it is by far the best solution I have), but somehow I do not feel like it is working well. I used to do this in Excel (just hit Alt+F11) as I usualy working with XLS data and generate INDD file based on them.

But it does not seem to work well for me. I go to "Tools>References", check the "Adobe Indesign CS4 Type Library" and then start typing.

I do not think I see all methods/properties for InDesign object as:

1) I see Dialog property of myInDesign object, but it has no "Add" method (even though I am positively sure that there is such method)

2) I see all properties which are MS Word specific which had no meaning in context of Indesign.Application object

I use CTRL+J to list properties/methods.

Does this block of code work for you? I mean do you get code hints/intellisense sugestions aftrer you type each dot?

Set myIndesign = CreateObject("InDesign.Application.CS4")
Set myDialog = myIndesign.Dialogs
Set myDialog = myIndesign.Dialogs.Add
myDialog.Cancel = True

Thank for your time

Matus