• 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
Checking for return at start of string (OS 10.1)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking for return at start of string (OS 10.1)


  • Subject: Checking for return at start of string (OS 10.1)
  • From: Simon Forster <email@hidden>
  • Date: Fri, 5 Oct 2001 10:40:00 +0100

This one is starting to do my head in...

I've parsed out a file to a list using return as the text item delimiter. Gives me something like:

{"drwx------ folder 5 Sep 19 15:07 ~nethues_rw", "
drwx------ folder 4 Oct 03 10:51 ~noblesvenues", "
drwx------ folder 28 Sep 20 16:53 ~Regus", "
drwx------ folder 13 Oct 01 17:25 ~rettie", "
drwx------ folder 33 Aug 30 10:41 ~riley", "
drwx------ folder 68 Jul 26 12:02 ~RileyNew 2001-07-26", "
drwx------ folder 14 Aug 13 14:39 ~RileyNew 2001-08-13", "
drwx------ folder 14 Aug 30 12:05 ~RileyNew 2001-10-12", "
drwx------ folder 15 Mar 28 2001 ~wiccaways", "
"}

Doing some further processing, I want to check whether each item in the list starts with a return. So:

repeat with this_item in dir_listing
if text item 1 of this_item is equal to "
" then

never evaluates to true. Tried begins with, coercing to string, specifying the return as return, ascii characters (both Mac and Unix) etc.

Returning text item 1 of this_item gives me the expected result of:

"
"

but I cannot get the conditional to work with a return, however I specify that return.

I assume I must be doing something really silly - which in my slightly "morning after the night before" state I just cannot see.

I'll now work around this but if someone could tell me what's going on here I'd be grateful.

TIA

Simon Forster
________________________________________________
LDML Ltd, 4/5 Hazlitt Mews, London, W14 0JZ, UK
<tel int="+44 20 7602 9370" uk="020 7602 9370">
<fax int="+44 20 7371 6662" uk="020 7371 6662">
<mailto:email@hidden>
________________________________________________


  • Follow-Ups:
    • Re: Checking for return at start of string (OS 10.1)
      • From: AppleScript Guru <email@hidden>
  • Prev by Date: Re: opening the control strip?
  • Next by Date: Scripting TE+ under OS 10.1: unwanted launch of Classic
  • Previous by thread: Re: opening the control strip?
  • Next by thread: Re: Checking for return at start of string (OS 10.1)
  • Index(es):
    • Date
    • Thread