Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to reference InDesign CS 5.5 in a vbscript?

Community Beginner ,
May 10, 2011 May 10, 2011

Having done mostly AppleScript and JavaScript in recent years I got stuck on what must be dead simple, but I can't figure it out, that is, how to create a reference to the InDesign application object.

With previous version this is what I do

set myInDesign = CreateObject("InDesign.Application.CS3")

But I can't find the proper version string, CS55, CS5.5, CS5_5 etc does not work. Nor can I leave the version number out, because that will launch CS4 (which is also installed on the machine

Please help with this annoying problem.

TOPICS
Scripting
5.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 10, 2011 May 10, 2011

Try regenerating the TLB (type library) as discussed by Chuck Weger in Re: InDesign 7.0 breaks Visual Basic reference.

If you're not using a UI that lets you interactively browse for COM+ objects, that's probably a mistake. Have you tried Visual Studio? I'm not a Windows developer, so I don't really understand this stuff.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 29, 2011 Aug 29, 2011

Hi!

I'm struggling with the same problem with cs5.5. Did you find a solution?

Thanks for help!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2011 Aug 29, 2011

Did you try starting InDesign as an admin?

Harbs

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 29, 2011 Aug 29, 2011

Thanks for fast answer!

The problem is the script-string that is written above (set myInDesign = CreateObject("InDesign.Application.CSxx?")ActiveX component can't create object so I guess the syntax is wrong. I've tried with 5, 5.5, 55 and so on...Tried the administrator-run as well but with no improvement.

The vb-program stops at the create object part with error message

I can use vb script with CS5, it's just CS5.5 that I have a problem with.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2011 Aug 29, 2011

I'm pretty sure the correct syntax is 5.5, but I don't really do much VB.

Make sure the COM object is properly installed.

Beyond that, I'm not going to be much help.

Harbs

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 29, 2011 Aug 29, 2011

Ok, thanks anyway.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 31, 2011 Aug 31, 2011

Can't you take a look at the VB script samples that came with your InDesign? That is what I did.

I am running CS5 myself, and I connect from VB with CreateObject("InDesign.Application").

I assume this just runs whatever version is installed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2011 Sep 01, 2011

I found this tutorial document for CS5.5:

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/InDesignScri...

It looks like CreateObject("InDesign.Application") is the correct way of doing it (there is an example on page 10).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 01, 2011 Sep 01, 2011

That's not the best way of doing it.

It will target the currently "default" app. So when you users install CSNext, the scripts will cease to work in CS5.5...

I don't have a better solution, but you are warned...

Harbs

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2011 Sep 01, 2011

But isn't that what you typically want? I only see it as an advantage that you can install a new CS version, and not have to edit all of your existing scripts. What is the point of continuing to use an older version if you have installed a new one?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 01, 2011 Sep 01, 2011

If you are working on a document that needs to be compatible with users of older versions is one pretty common reason...

Harbs

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2011 Sep 01, 2011

Yes, that could be an issue. I just noticed that the OP mentioned he can not leave out the version number, because that will launch CS4, which is also installed.

One thing seems a bit odd to me though: If we start up InDesign, and activate a script from within the panel, why doesn't it just connect to the currently running instance of InDesign? JavaScript seems to do that, as there is no explicit connection string. I would expect any of my scripts to run on the InDesign version I activated them from, no matter what language they are written in, and no matter how many other versions of InDesign I may have installed on the same computer. It seems like Adobe have missed something here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 02, 2011 Sep 02, 2011

Thanks, this worked out really fine! (to leave the version number out) Sometimes you make it harder than it really is

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 21, 2011 Sep 21, 2011

Well, this works for CS 5.5 as the newest version. But what, if there once is an newer version, i.e. CS 6, and you want to start explicitly CS 5.5, because you've installed different versions of InDesign on the same computer? This is a common szenario.

I hope, Adobe will correct this mistake until CS 6 is coming up, otherwise you can't start CS 5.5 and CS 6 at the same time.

Hmmm.....

P.S In the windows registry, there is no class entry for CS5.5, only CS5. And the CS5-entry is mapped to C:\Program Files (x86)\Adobe\Adobe InDesign CS5.5\InDesign.exe. Why ?????

Is there another solution, to start DIFFFERENT InDesign Versions on the SAME computer at the SAME time. My customers are requesting so.

Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 21, 2011 Sep 21, 2011

@cicero111,

I don't really understand your concern. When a CS6 at some point is introduced, why would you continue to run your scripts on CS5.5 instead of CS6? Don't you install CS6 because that is the one you want to use? Running different versions of the same software on the same computer is asking for trouble, and I don't see the point. I can understand that you don't want to use the new version if it is bugged or something, but then simply don't install it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 21, 2011 Sep 21, 2011

@FrankB62

The answer is simple: As a service provider, I have different customers, which all run different versions of InDesign. So I have to install all of these different InDesign versions on my computer and then choose a special script for a special customer with a special InDesign version ...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 21, 2011 Sep 21, 2011
LATEST

Adobe supports multiple versions installed, and it's quite a common and

realistic scenario. Because backwards compatibility isn't really there,

if you ever deal with multiple file versions, you'll want to have

CS3, CS4, and CS5 around. And if you might ever have to send a file

to someone with one of those versions, especially for CS3, you'll want

the versions along the way to save a file that can be used in older versions.

But that's not all. Our production environment in CS5, because of

external dependencies. But we occasionally get a CS5.5 document. Or we

want to test features of CS5.5 even though we're not ready for it yet.

And when we find a bug or an issue in CS5, we want to easily see if we

can reproduce it in CS5.5. And also, in CS5.5, if we find a bug, we

want to go see if it was introduced in CS5.5, or if it was not a

problem in CS5.

We could do this with virtual machines, or by quintupling the number

of physical machines we have, but those are all awkward

solutions. Installing multiple versions of the software on one machine

is supported, and works.

Under the Mac OS, there is no issue with referencing the correct version

from an Applescript. I'm not sure what is broken for VBScript, and I'm

not enough of a VB person to be sure where the blame lies.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines