🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20744

Re: Applescript: make a text frame on a master page

#20744
From: Carl Davaz
Date: Wed, 05 Jun 2002 04:43
35 lines
3814 bytes
Hey Shane!, 

I thought what wrote you below was really neat and quite a utility approach: 

 tell application "InDesign 2.0.1" �tell document 1 ��set theProps to properties of text frame "Main" of master spread 2 ��make text frame at page 3 with properties theProps �end tell end tell  

So I made a document and tried to do some different things (below), but the paragraph styles associated with the Caption and Credit frames weren't applied. 

 tell application "InDesign 2.0.1" 	tell document 1 		set theProps1 to properties of text frame "Caption" of master spread 2 		set theProps2 to properties of text frame "Credit" of master spread 2 		set theProps3 to properties of rectangle "Photo" of master spread 2 		make text frame at page 3 with properties theProps1 		make text frame at page 3 with properties theProps2 		make rectangle at page 3 with properties theProps3 	end tell end tell  

So I thought the script below would account for the text properties, but it failed when I did the "tell theCaption" part.  tell application "InDesign 2.0.1" 	tell document 1 		set theProps1 to properties of text frame "Caption" of master spread 2 		set theProps2 to properties of text frame "Credit" of master spread 2 		set theProps3 to properties of rectangle "Photo" of master spread 2 

	set theTextProps1 to get properties of text 1 of text frame "Caption" of master spread 2 		set theTextProps2 to get properties of text 1 of text frame "Credit" of master spread 2 

	set theCaption to make text frame at page 3 with properties theProps1 		set theCredit to make text frame at page 3 with properties theProps2 		set theImage to make rectangle at page 3 with properties theProps3	 

tell theCaption 			set text properties of text 1 to theTextProps1 		end tell 

		tell theCredit 			set text properties of text 1 to theTextProps2 		end tell	 

	end tell end tell  

I got it to work by applying the paragraph styles as shown below,... 

 tell application "InDesign 2.0.1" 	tell document 1 		set theProps1 to properties of text frame "Caption" of master spread 2 		set theProps2 to properties of text frame "Credit" of master spread 2 		set theProps3 to properties of rectangle "Photo" of master spread 2 

set theTextProps1 to get properties of text 1 of text frame "Caption" of master spread 2 set theTextProps2 to get properties of text 1 of text frame "Credit" of master spread 2 

		set theCaption to make text frame at page 3 with properties theProps1 		set theCredit to make text frame at page 3 with properties theProps2 		set theImage to make rectangle at page 3 with properties theProps3 

		set applied paragraph style of text 1 of theCaption to paragraph style "Italic caption" 		set applied paragraph style of text 1 of theCredit to paragraph style "Credit" 	end tell end tell  

... but is it possible to set the text properly by accessing and applying the text properties as you did with the first example of accessing and applying the text frame properties? Can you point out what I'm doing wrong? 

Carl
Technical Details
Message-ID: <ef8e3b9.8@WebX.aaQKaf7vad4>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <ef8e3b9.-1@WebX.aaQKaf7vad4>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,8e47b5875d947fcb
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-06-04 22:07:33 PST
From: "Carl Davaz" <cdavaz@guardnet.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Applescript: make a text frame on a master page
Message-ID: <ef8e3b9.8@WebX.aaQKaf7vad4>
Date: Tue, 4 Jun 2002 21:43:16 -0700
References: <ef8e3b9.-1@WebX.aaQKaf7vad4>
Lines: 97
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit