Article View: adobe.scripting.indesign
Article #20911Re: InDesign 2.0 and C#
From: Joel Neubeck
Date: Fri, 24 May 2002 14:24
Date: Fri, 24 May 2002 14:24
20 lines
2449 bytes
2449 bytes
I did find the "scripting.rpln" file. In C# what you have to do is use "Tlbimp.exe" which converts the type definitions found within a COM type library into equivalent definitions in managed metadata format.
In your C# code you will compile the new DLL into you code and write some C# code that define a name space and reference a class like follows.
using InDesign;
class InDesign Class { static void Main(string[] args) { Application objIDApp = new Application(); Console.WriteLine(objIDApp.Version); } }
The error I mentioned above occurs when referencing any properties or methods from the "Application" class.
With the .NET SDK an application is included called "ILDASM.exe" (MSIL Disassembler) This app Takes a PE (portable executable) file that contains MSIL (Microsoft intermediate language) code and creates a text file suitable as input to the MSIL Assembler. The Disassembler will give you a GUI interface to look at all of the Classes and how they were converted.
When looking at the dll created by "Tlbimp" it appears that InDesign gets converted into a series of "Interfaces" and not "Classes". This is not uncommon to use interfaces but I think that the error I described is the direct result of there being NO classes in this managed metadata format file (DLL). My guess is that it is inappropriate to use the "scripting.rpln" file to create the managed metadata format.
If you have any experts at Adobe that you could speak with I would be interested in hearing there take on this. Do you know of anyone that uses InDesign scripting through Java or C++?
-Joel
Technical Details
Message-ID:
<ef8b07d.1@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!cyclone.bc.net!news-hub.siol.net!fr.clara.net!heighliner.fr.clara.net!213.73.101.75.MISMATCH!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef8b07d.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,b70a3c6e4b5df212 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-05-24 07:38:35 PST From: "Joel Neubeck" <joel@neubeck.net> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!cyclone.bc.net!news-hub.siol.net!fr.clara.net!heighliner.fr.clara.net!213.73.101.75.MISMATCH!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: InDesign 2.0 and C# Message-ID: <ef8b07d.1@WebX.aaQKaf7vad4> Date: Fri, 24 May 2002 07:24:51 -0700 References: <ef8b07d.-1@WebX.aaQKaf7vad4> Lines: 42 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit