🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9566

Place Image (javascript)

#9566
From: mmarconi
Date: Thu, 17 Aug 2006 20:53
16 lines
1208 bytes
If I use this simple code to place contents and an image in a text frame:

var doc = app.documents.add();
var page = doc.pages.lastItem();

var frame = page.textFrames.add({geometricBounds:[10,10,50,500]});
frame.contents = 'What the h!!!';
var img = frame.place(File('~/Desktop/C157881.pdf'));

Although the image is placed the frame's contentType is changed to graphic, and the text disappears.

However drawing a text frame manually in Indesign CS2 adding text to it then placing an image inside it works just as expected. For instance you can center the text and the image to the text frame and so forth.

Is there something I'm missing in the code?

Thanks MIke
Technical Details
Message-ID: <3bc14ccd.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,24556318f11d5c88
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: mmarconi@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Place Image (javascript)
Message-ID: <3bc14ccd.-1@webcrossing.la2eafNXanI>
Date: Thu, 17 Aug 2006 13:53:16 -0700
Lines: 20
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing