• 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
Re: Replacing Codes with Text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacing Codes with Text


  • Subject: Re: Replacing Codes with Text
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 15 Jun 2001 13:11:43 -0700

On 6/15/01 1:07 PM, I wrote:

> Here's the script:

Excuse me. I forgot to reset TIDs, and remembered just as I clicked "Send",
wouldn't you know? Try again:

------------------------------------------

property loc : ""

if loc = "" then set loc to choose file with prompt "Where's the text file?"

set list1 to {"agn", "bal", "bmp", "bof"}
set list2 to {}

set f to open for access loc
set r to read f
close access f


set abbrList to {}
set fullnameList to {}
set AppleScript's text item delimiters to {" = "}

repeat with i from 1 to (count paragraphs of r)
set aLine to paragraph i of r
try -- ignore blank lines
set end of fullnameList to text item 2 of aLine --do this one first
to error out of blank lines
set end of abbrList to text item 1 of aLine
end try
end repeat
set AppleScript's text item delimiters to {""}

repeat with j from 1 to (count list1)
set thisAbbr to item j of list1
repeat with k from 1 to (count abbrList)
if thisAbbr = item k of abbrList then
set end of list2 to item k of fullnameList
exit repeat
end if
end repeat
end repeat
list2

-----------------------------------------------------

--
Paul Berkowitz


References: 
 >Replacing Codes with Text (From: email@hidden)

  • Prev by Date: Re: Replacing Codes with Text
  • Next by Date: scripting swatches in Illustrator 9
  • Previous by thread: Re: Replacing Codes with Text
  • Next by thread: Re: Replacing Codes with Text
  • Index(es):
    • Date
    • Thread