• 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
deleting text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

deleting text


  • Subject: deleting text
  • From: "Ruby Madraswala" <email@hidden>
  • Date: Tue, 25 Nov 2003 13:51:09 -0500
  • Thread-topic: Creating a Record

Hi all
I am having problem with a simple script..........................

I have text files (over 60 to 200 paragraphs). I am trying to write a script to delete the "\" always in front of a word and "|" (pipe) at end of a word. "\" and "|" can be at beginning and end of one word. Sounds simple but I can't get the delete statement to work. What am I missing here and am I using the wrong command and or wrong approach. (trying with the slash first). Can tell I am a beginner at scripting.

Set NewFile to Pathname
On deleteslash
Set outfile to open access file NewFile with write permission
Set File1Text to read outfile from 1
Set wordlist to every word of File1Text
Repeat with aword in wordlist
Display dialog aword - to debug
If aword contains "\\" then
Display dialog aword -to debug
Delete character 1 of aword
End if
End repeat
Close access outfile
Return
End deleteslash

Sample text file:
Debugging - this isn't \removing| illegal listening devices from your office. It's \tracking down and fixing| script problems.

Thanks in advance
Ruby
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: keystroke "f key"
  • Next by Date: Re: BBEdit Zap Gremlins
  • Previous by thread: Re: keystroke "f key"
  • Next by thread: Re: deleting text
  • Index(es):
    • Date
    • Thread