🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15228

Re: Scripting Text

#15228
From: Olav_Kvern
Date: Fri, 12 Dec 2003 21:55
33 lines
1615 bytes
Kris--

It's pretty easy to get the reference. What happens after that is as difficult or easy as you want!<g>



tell application "InDesign CS" 
	--I'll include some standard error handling here. 
	if (count documents) > 0 then 
		set mySelection to selection 
		if (count mySelection) > 0 then 
			set mySelection to object reference of item 1 of selection 
			if class of mySelection is insertion point or class of mySelection is text then 
				if class of mySelection is insertion point then 
					set myInsertionPoint to item 1 of mySelection 
				else if class of mySelection is text then 
					set myInsertionPoint to insertion point 1 of mySelection 
				end if 
				--Your script goes here (and does something with "myInsertionPoint"). 
			end if 
		else 
			display dialog "Please select a text frame and try again." 
		end if 
	else 
		display dialog "Please open a document, select a text frame, and try again." 
	end if 
end tell

Does that help?

Thanks,

Ole
Technical Details
Message-ID: <2ccee47b.5@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
References: <2ccee47b.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,7e44b16a18828e29
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-12-12 14:08:00 PST
From: Olav_Kvern@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: Scripting Text
Message-ID: <2ccee47b.5@webx.la2eafNXanI>
Date: Fri, 12 Dec 2003 13:55:28 -0800
References: <2ccee47b.-1@webx.la2eafNXanI>
Lines: 34
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit