🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17855

Re: Select all - Scripting Text Frame and Text Wrap (AS)

#17855
From: Kari Puikkonen
Date: Fri, 09 May 2003 15:52
97 lines
3342 bytes
Yes, those Quark anomalies can be quite time consuming...

I modified a script that selects all the text frames (that has the text wrap) in active spread (page) and removes then the text wrap...



tell application "InDesign 2.0.2" 
	tell active spread of active window 
		set myPageItems to text frames 
		set myTextWraps to {} 
		repeat with myPageItem in myPageItems 
			if text wrap of myPageItem is not none then 
				copy myPageItem to end of myTextWraps 
			end if 
		end repeat 
	end tell 
	select myTextWraps

	set myPageItems to {text frame} 
	set mySelection to selection 
	if (count mySelection) > 0 then 
		repeat with myCounter from 1 to (count mySelection) 
			if (class of item myCounter of mySelection) is in myPageItems then 
				set myPageItem to item myCounter of mySelection 
				set properties of myPageItem to {inset spacing:{0, 0, 0, 0}} 
				set properties of myPageItem to {text wrap:none} 
			end if 
		end repeat 
	end if 
end tell



...but here comes the headache of the week! How do I modify my script to select all the text frames in all the pages, so that I don't I have go page by page?

All these three approaches gave the error: -->	InDesign 2.0.2 got an error: An error of type 30470 has occurred.

1.)



tell application "InDesign 2.0.2" 
	tell active document 
		repeat with j from 1 to (count pages) 
			repeat with i from 1 to (count text frames of page j) 
				set myPageItems to text frames 
				set myTextWraps to {} 
				repeat with myPageItem in myPageItems 
					if text wrap of myPageItem is not none then 
						copy myPageItem to end of myTextWraps 
					end if 
				end repeat 
			end repeat 
		end repeat 
	end tell 
	select myTextWraps 
end tell



2.)



tell application "InDesign 2.0.2" 
	set theTextFrames to object reference of every text frame of active document 
	repeat with myTextFrame in theTextFrames 
		set myTextWrap to text wrap of the properties of myTextFrame 
		if text wrap of myTextFrame is not none then 
			select myTextFrame 
		end if 
	end repeat 
end tell



3.)



tell application "InDesign 2.0.2" 
	set allFrames to all page items of active document 
	repeat with aFrame in allFrames 
		if (class of aFrame is text frame) and � 
			(text wrap of aFrame is not none) then 
			select aFrame 
		end if 
	end repeat 
end tell



What is "error of type 30470" or what is wrong with my approaches?

Any help in this matter would be highly appreciated!

Kari
Technical Details
Message-ID: <1de909b0.2@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.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: <1de909b0.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,4bf66e2b292dec9
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-09 09:08:18 PST
From: "Kari Puikkonen" <kari.puikkonen@welho.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.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: Select all - Scripting Text Frame and Text Wrap (AS)
Message-ID: <1de909b0.2@WebX.la2eafNXanI>
Date: Fri, 9 May 2003 08:52:31 -0700
References: <1de909b0.-1@WebX.la2eafNXanI>
Lines: 86
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit