🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #8429

Re: C#/VB.net pageitem invalid cast

#8429
From: Bob_Stucky
Date: Fri, 13 Oct 2006 13:19
9 lines
1141 bytes
Many of InDesign's methods return more than one type of object. That is by design, and intended to work with the less-strongly-typed scripting languages such as VBScript, AppleScript, or JavaScript.

Unfortunately, C# and VB.Net do not support that. VBScript supports a Variant type, which works, but that was removed in VB .Net.

There is no easy solution to your problem other than to NEVER use a method that can return more than 1 type.

You could try using JScript .Net, which does retain the loose typing features of JavaScript.

Regards
Technical Details
Message-ID: <3bc1f56b.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.ecp.fr!news.stben.net!webcrossing
References: <3bc1f56b.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5784fa3b2eb66ac3
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob_Stucky@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Re: C#/VB.net pageitem invalid cast
Message-ID: <3bc1f56b.0@webcrossing.la2eafNXanI>
Date: Fri, 13 Oct 2006 06:19:39 -0700
References: <3bc1f56b.-1@webcrossing.la2eafNXanI>
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.ecp.fr!news.stben.net!webcrossing