• 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: Trim space chars from start of line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trim space chars from start of line


  • Subject: Re: Trim space chars from start of line
  • From: Steve Mills <email@hidden>
  • Date: Mon, 25 Jul 2011 16:17:07 -0500

On Jul 25, 2011, at 16:10:38, Zavatone, Alex wrote:

> Awesome idea, and I would have thought it would have been faster, but with my original script taking 20 seconds, this takes 26.

That's strange. How much text are you feeding it and how many leading spaces are there?

> I did learn something amazing though.
> 	return text (i) thru -1 of t
> is MUCH faster than
> 	return characters (i) thru num of t.
>
> It's 26 vs 49 seconds.
>
> What is your line doing?

It works on a hunk of text as a whole "object" rather than a list of characters. Or are you asking about the -1? That's way of specifying how many items/characters from the end of a list/string you want. -1 is the last, -2 is the 2nd to the last, etc. You let AppleScript do the counting internally instead of you having to supply a variable for the length of the object.

--
Steve Mills
Drummer, Mac geek

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Trim space chars from start of line
      • From: "Zavatone, Alex" <email@hidden>
References: 
 >Re: Trim space chars from start of line (From: Steve Mills <email@hidden>)
 >Re: Trim space chars from start of line (From: "Zavatone, Alex" <email@hidden>)

  • Prev by Date: Re: Trim space chars from start of line
  • Next by Date: Re: Trim space chars from start of line
  • Previous by thread: Re: Trim space chars from start of line
  • Next by thread: Re: Trim space chars from start of line
  • Index(es):
    • Date
    • Thread