Copy link to clipboard
Copied
Hi
I have a number of scripts I've written in VB 5.0, targeting CS2. We're now using a mix of CS2/4 and shortly plan to move to CS6 (not CC as we have some external plugins provided by a third party and need stability).
My scripts create picture frames, populate them with EPS or pdf files, arrange them on a page and print them out for proofing and other purposes.
I've now moved to Visual Studio 2015 which I understand is not great with Indesign scripting although the basics are working for me. Can anyone point me to a resource that would help? There seems to be issues with the way paramaters are passed.
As an example:
Private Sub btnTutorial_Click(sender As Object, e As EventArgs) Handles btnTutorial.Click
Dim myIndesign As Object
Dim MyDoc As Object
Dim myTextFrame As Object
myIndesign = CreateObject("InDesign.Application")
myIndesign.DocumentPreferences.PageWidth = "80mm"
myIndesign.DocumentPreferences.PageHeight = "150mm"
myDoc = myIndesign.documents.add()
myTextFrame = MyDoc.textFrames.add()
myTextFrame.GeometricBounds("0mm", "0mm", "70mm", "60mm")
myTextFrame.Contents = "Hello World."
End Sub
This code works apart from the line referencing GeometricBounds. I've tried various formats and this method compiles successfully but when I run it I get
'Value doesn't fall within the expected range'. It looks like I'm passing something but what exactly?
Any help or directions would be greatly appreciated.
TIA
Copy link to clipboard
Copied
https://forums.adobe.com/people/john+galvin-clare wrote
… This code works apart from the line referencing GeometricBounds. I've tried various formats and this method compiles successfully but when I run it I get'Value doesn't fall within the expected range'. It looks like I'm passing something but what exactly?
Hi,
I'm not working with VB, just ExtendScript, so I can only guess what's going wrong with GeometricBounds.
Will it help if you assign the values as an array? GeometricBounds is no method or function. At least not in ExtendScript.
myTextFrame.GeometricBounds = [ "0mm", "0mm", "70mm", "60mm" ]
Regards,
Uwe
Copy link to clipboard
Copied
Thanks
I've tried that in every combination I can think of but I'm getting syntax errors and it won't compile.
Regards