• 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: [SUL] Remove very last CR
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SUL] Remove very last CR


  • Subject: Re: [SUL] Remove very last CR
  • From: Robert Poland <email@hidden>
  • Date: Sun, 18 Sep 2005 15:23:07 -0600

On 9/18/05 8:55 AM, "Robert Poland" <email@hidden> wrote:

 Hi,

 Tried;
 change "\\r$" into "" in w with regexp -- remove last carriage return

 but that removes the last CR of EACH paragraph.

 Is there a way to remove ONLY the last CR in a Document?

 Tia,
 --
 Bob Poland - Fort Collins, CO
 http://www.ibrb.org/
 _______________________

Found it,

change "\z\\r$" into "" in w with regexp -- remove trailing carriage return

regexp is for doing things that are in a pattern, hundreds or thousands of times generally. Why use regexp to remove just one, clearly positioned, CR? Why not just remove it normally?

if someText ends with (return) then set someText to text 1 thru -2 of someText

--
Paul Berkowitz

I'm able to find the (return) in the last line but, as yet, I can't figure out how to delete it. Here's some of my trys.


replace text of last line of window 1 looking for "^c " replacing with "" -- delete last CR of last paragraph

-- delete last CR of last paragraph
set someText to last line of w as text
if someText ends with (return) then set someText to text 1 thru -2 of someText
replace last line of w with someText


Tia,
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
_______________________________________________
SUL mailing list
email@hidden
Archives: http://lists.satimage-software.com:20080/mailman/private/sul
Options: http://lists.satimage-software.com:20080/mailman/listinfo/sul
Unsubscribe: email@hidden
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
_______________________________________________
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


  • Prev by Date: Entourage GUIDs
  • Next by Date: Re: How to deal with Asynchronous Finder operations
  • Previous by thread: Entourage GUIDs
  • Next by thread: Re: How to do some AppleScript inside a Perl program to label duplicates
  • Index(es):
    • Date
    • Thread