RE: deleting text - problem solved
RE: deleting text - problem solved
- Subject: RE: deleting text - problem solved
- From: "Ruby Madraswala" <email@hidden>
- Date: Tue, 25 Nov 2003 16:36:41 -0500
- Thread-topic: deleting text
Thanks Michelle, it worked.
Ruby
-----Original Message-----
From: Michelle Steiner [
mailto:email@hidden]
Sent: Tuesday, November 25, 2003 3:40 PM
To: Ruby Madraswala
Cc: email@hidden
Subject: Re: deleting text
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.