🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18022

Picture in Text box

#18022
From: Kim Kohen
Date: Tue, 06 May 2003 00:25
41 lines
2160 bytes
I swear this has worked before so it's possible it broke with either an OS or ID update. The following snippet is supposed to place a graphic into an existing text frame or, if the graphic isn't present, place the text that describes it.

	tell application "InDesign 2.0.2"
			set mydoc to active document
			tell mydoc
				tell page 1
					if exists text frame theadnumber then
						set myFrame to (text frame theadnumber)
						try
							place myad on myFrame
							tell myFrame
								fit graphic given content to frame --proportionally
							end tell
						end try
					else
						try
							set myFrame to make text frame at page 1 with properties {geometric bounds:{theycoord, thewidth2, theycoord + theheight, thewidth2 + theadwidth}, label:theadnumber}
						on error errmess
							beep
							display dialog "Couldn't create the ad frame due to error: " & errmess
						end try
						try
							place myad on myFrame
							tell myFrame
								fit graphic given content to frame
							end tell
						on error
							set contents of myFrame to thetext
						end try
					end if
				end tell
			end tell -- mydoc
		end tell -- ID

the frames are created correctly but it errors out trying to place the graphic (which exists). Are there any issues placing graphics onto text frames (or anything else I'm missing)?

I'm getting a tad frustrated because it was working fine previously

cheers

kim
Technical Details
Message-ID: <1de90179.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,e181e8af9b8a9508,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-05 17:39:55 PST
From: "Kim Kohen" <kim@webguide.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Picture in Text box
Message-ID: <1de90179.-1@WebX.la2eafNXanI>
Date: Mon, 5 May 2003 17:25:33 -0700
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit