• 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: read a specific word of a text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read a specific word of a text file


  • Subject: Re: read a specific word of a text file
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 23 Sep 2004 01:11:02 -0700


On Sep 23, 2004, at 12:58 AM, Jasneet Kaur wrote:

So could you please help me do that using AppleScript with the constraint
that there can be no user intervention, that is the dialog box doesn't
appear... rather, the words to be replaced can be hard coded into the
script.

Here's the full script:

set x to "word_to_be_replaced"
set y to "word_to_replace_with"
set foo to open for access file "disk:folder:folder:file" with write permission
set bar to read foo
set {tid, text item delimiters} to {text item delimiters, x}
set barlist to text items of bar
set text item delimiters to y
set z to barlist as text
set text item delimiters to tid
set eof of foo to 0
write z to foo
close access foo


--
Never play strip Tarot.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >read a specific word of a text file (From: Jasneet Kaur <email@hidden>)

  • Prev by Date: Re: read a specific word of a text file
  • Next by Date: Re: read a specific word of a text file
  • Previous by thread: Re: read a specific word of a text file
  • Next by thread: unsubcribe
  • Index(es):
    • Date
    • Thread