On Jul 25, 2011, at 17:17 , Zavatone, Alex wrote:
> On Jul 25, 2011, at 4:03 PM, Deivy Petrescu wrote:
>> set t to " set myText to characters 2 through myLength of myText as string"
>> set t to characters of t
>> if (contents of item 1 of t) = space then repeat while (contents of item 1 of t) is space
>> set t to rest of t
>> end repeat
>> t as string
> Wow. That's crazy.
> Unfortunately, it fails if the line is all spaces.
I use this script to remove blanks of beginning of a line.
To remove blanks from a text (with paragraphs) then:
set t to " "
set t to characters of t
if (count of t) > 0 then repeat while (contents of item 1 of t) is space
set t to rest of t
if (count of t) = 0 then exit repeat --- if you want to keep the space
--then change =0 to =1
t as string
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