Re: strings, again and again
Re: strings, again and again
- Subject: Re: strings, again and again
- From: Kurt Klamp <email@hidden>
- Date: Sun, 3 Feb 2008 14:39:15 +0100
Am 03.02.2008 um 12:02 schrieb Gary (Lists):
<snip>
Here's a version of your script that works. I had to guess what
you might
have in 'descriptionRange', since you didn't show that (you should,
it would
help.)
set descriptionRange to {"a1234", "b5678", "c9012", "d3456"}
set jobNumRange to {}
repeat with i from 1 to (count descriptionRange)
try
set firstPull to find text "^[a-z][0-9]{4}" in item i of
descriptionRange with regexp
or
set firstPull to find text "^[a-z][0-9]{4}" in item i of
descriptionRange with regexp and string result
-- PROBLEM: set item i of jobNumRange to firstPull
-- That's not how you add to a list.
-- Use:
copy matchResult of firstPull to end of jobNumRange
and
copy firstpull to end of jobNumRange -- assumed you use the 'with
string result option of the command
or
set item i of jobNumRange to firstpull -- assumed that (count
descriptionRange)=(count jobNumRange) what's here probably is the
case because the OP wrote
this just populates the target list with
"empty"
This is only possible if there is a non-empty list at beginning of
the repeat loop.
-- Kurt
_______________________________________________
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