• 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: strings, again and again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strings, again and again


  • Subject: Re: strings, again and again
  • From: "Justin Laden" <email@hidden>
  • Date: Mon, 4 Feb 2008 16:02:45 -0500

Thanks for the responses everyone, and your suggestions did help clear
some things up, but not--and I want to add emphasis here--with Excel.

Let me provide an example--I wrote this test script, which works,
outside of my main code:


set testList to {{"Q1718_00_"}, {"D1198 BAI"}, {"A3000"}}

set twoList to {{}, {}, {}}

set item 2 of twoList to find text "^[a-zA-Z][0-9]{4}" in item 2 of
testList with regexp

item 2 of twoList --> {D1198}


That's real data in there, and it works (I did shorten it, removed the
matchResult conversion, etc.)

You all helped me see that I can't populate an empty list the way I
thought I could.  Now, I add a new empty list on every run through the
loop--see below.

So first, I add a list with an empty string to the end of a my target
range, THEN, I test the other range for the number combo, and then I
do it again.  But, with e


	repeat with i from 2 to (z)
		copy {""} to end of jobNumRange
		try
			set firstPull to (find text "^[a-zA-Z][0-9]{4}" in item i of
descriptionRange with regexp)

			set list i of jobNumRange to matchResult of firstPull

		on error

			set item i of jobNumRange to {""}

		end try

	end repeat

copy the value of range ("I1:I" & z) to jobNumRange


No matter what, it doesn't work in EXCEL--give it a shot!

The problem seems to be that I can't get the new populated list to be
copied into an Excel column.  This could be because the list is NOT a
list of lists, but a list of strings and lists...  Not sure how to get
the regular expressions to be returned as lists.

Also, it seems to add lists in between the results, like so:

"D1198", {""}, "D1243", {""}, "D1251", {""}, "D1285", {""}, "D1352",
{""}, {""}, {""}

Kurt, I'll fix the error handling later--thanks for the help.  I want
to get it into Excel first:)

-Justin
 _______________________________________________
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: strings, again and again
      • From: "Gary (Lists)" <email@hidden>
    • Re: strings, again and again
      • From: Kurt Klamp <email@hidden>
    • Re: strings, again and again
      • From: Kurt Klamp <email@hidden>
  • Prev by Date: Re: Scripting of Data Detectors again in OS X 10.5?
  • Next by Date: Re: strings, again and again
  • Previous by thread: Re: strings, again and again
  • Next by thread: Re: strings, again and again
  • Index(es):
    • Date
    • Thread