🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18205

Re: Script to export stories as XML and obtain external attributes

#18205
From: James Naylor
Date: Tue, 08 Apr 2003 19:01
41 lines
2340 bytes
The excerpt of the script which writes the attributes is:

			-- write xml jt attributes to InDesign!
			-- from james & a bunch of message boards on t'internet
			tell application "InDesign 2.0.2"
				set sectionName to item 6 of jobTicketList
				set authorName to item 7 of jobTicketList
				set copyrightStatus to item 71 of jobTicketList

				--	display dialog box for each attribute for testing purposes
				display dialog "the author is " & authorName & return & "the section is " & sectionName �
					& return & "the copyright status is " & copyrightStatus

				try
					tell myDocument

						repeat with myXMLCounter from 1 to (count XML Elements)
							-- repeat loop from adamcoop "Multiple instances of an XML tag" 3/11/03 8:52pm </cgi-bin/webx?50@@.1de84025/0>

							set myXMLElement to XML Element myXMLCounter
							if name of markup tag of myXMLElement is "Story" then

								--set myStoryTag to XML Element "Story"
								--set myBodyTag to XML Element "body" of myStoryTag

								tell myXMLElement to make XML Attribute with properties {name:"author", value:authorName}
								tell myXMLElement to make XML Attribute with properties {name:"section", value:sectionName}
								tell myXMLElement to make XML Attribute with properties {name:"copyright", value:copyrightStatus}

							end if
						end repeat

					end tell
				on error
					display dialog "Cannot Write Attributes!"
					return
				end try



			end tell --writing jt attributes
Technical Details
Message-ID: <1de8a6c0.0@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de8a6c0.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,82ec3cb55652c142,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-04-08 12:08:03 PST
From: "James Naylor" <james.naylor@rbi.co.uk>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Script to export stories as XML and obtain external attributes
Message-ID: <1de8a6c0.0@WebX.la2eafNXanI>
Date: Tue, 8 Apr 2003 12:01:43 -0700
References: <1de8a6c0.-1@WebX.la2eafNXanI>
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit