MACSCRPT Archives

November 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
DA Holman <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 27 Nov 2009 14:18:10 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (32 lines)
new to the list. I use AS primarily within InD (CS3 here), so I'll jump
right in ...

I assume you're using a character style for the ornament. try something like
this.

--to be sure you're starting with a clean search, tell the application:
set find text preferences to nothing
set change text preferences to nothing

--get a reference to your object style:
tell theDoc
	try
		set ornStyle to object reference of (every character style whose name is
"Style Name")
	on error
		set ornStyle to make character style with properties {name:"Style Name"}
-- insert your parameters
	end try
end tell

--enter the actual find/change values here:
set properties of find text preferences to {find what:"|", applied character
style:none}
set properties of change text preferences to {change to:"x", applied
character style:ornStyle}

--perform the search. 
--I define 'myObject' earlier on so I can choose to perform the search
within a selection or across the document.
tell myObject to change text

ATOM RSS1 RSS2