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

Re: deleting text


  • Subject: Re: deleting text
  • From: Michelle Steiner <email@hidden>
  • Date: Tue, 25 Nov 2003 13:39:46 -0700

On Nov 25, 2003, at 11:51 AM, Ruby Madraswala wrote:

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.

You are using the wrong approach. You can't delete characters from a string directly.

Try using text item delimiters; for example to remove the pipe, try this.

set applescript's text item delimiters to {"|"}
set wordlist to text items of File1Text
set applscript's text item delimiters to {""}
set File1Text to wordlist as text

Then repeat that with the slash, keeping in mind the special handling that a slash needs.

--Michelle

--
If you're not going somewhere, you're not getting anywhere.
_______________________________________________
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.

References: 
 >deleting text (From: "Ruby Madraswala" <email@hidden>)

  • Prev by Date: RE: deleting text - problem solved
  • Next by Date: RE:deleting text
  • Previous by thread: deleting text
  • Next by thread: Re: deleting text
  • Index(es):
    • Date
    • Thread