• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Search/replace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Search/replace


  • Subject: Search/replace
  • From: Gini Waters <email@hidden>
  • Date: Sat, 15 Mar 2008 11:14:09 -0400

Hi all
I'm am new to apple scripting. I'm not sure of the appropriate way to do this but I have a question. I'm trying to search and replace customer codes on a text file (usually Word) to my QuarkXPress tags. I've read a fair amount of posts, but haven't found the right example to build from. 

--Here's what I'm working with:

<CN>Chapter 1 <CT>Is America at Risk?

<CHO>Chapter Objectives

After reading the chapter and reflecting on the contents, you should be able to:

<NL>1. Identify the concern for food safety and the presence of foodborne illness in the United States.

2. Articulate an understanding of the term "biotechnology" as it relates to genetically modified food.</NL>

 <KT>Key Terms

agroterrorism—Includes purposeful adulteration/poisoning of agricultural crops and the food supply to cause illness or death.

biotechnology—Includes a gene slicing technique that enables scientists to insert genes into foods for the purpose of dealing with the environmental stresses the world now poses.

--I need to do Xpress tags that replace the <CN> with @CN: and also searches for bold  or italic words and surrounds them with <B> or <I>. I thought it'd be a pretty straightforward script but am struggling.

--I've found a few scripts that I thought might work, but don't....


tell application "Microsoft Word"
my ReplaceEverywhere("<CN>", "@CT:")
end tell

I wrote this:
tell application "TextCommands"
search text "This is a customer code: <CN>Chapter Number <CT>Chapter Title."
[finding <CT>]
replacing with "@CT:"
end

The script didn't like the "<" character... Any suggestions you have would be greatly appreciated!
Gini
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Search/replace
      • From: deivy petrescu <email@hidden>
    • Re: Search/replace
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: How to select some photos from iPhoto through script?
  • Next by Date: Re: Date math problem in Leopard
  • Previous by thread: Re: 10.4.9 versus 10.4.10
  • Next by thread: Re: Search/replace
  • Index(es):
    • Date
    • Thread