Re: strings, again and again
Re: strings, again and again
- Subject: Re: strings, again and again
- From: "Justin Laden" <email@hidden>
- Date: Tue, 5 Feb 2008 16:43:46 -0500
Gary, Kurt,
Thanks for all the help--but, shocker!--it works.
All I had to do was add two words.
Gary you helped me figure out I couldn't populate an empty list while
walking through a list full of values with a repeat loop. That's
where the following line came from (you can see the full code below):
But the secret for making this script work was making sure the list
was a list of lists, not a list of strings and lists! Honestly,
someone should come up with a better VBA to AS guide for Excel because
this must be a common problem for people porting into Office 2008!
Berkowitz's guide is good for seeing how AS works in Excel as an
application, but in my opinion it doesn't really provide a
transitional guide for those wanting to get advanced functionality out
of AS--all due respect.
Here's the code:
repeat with i from 1 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 item i of jobNumRange to matchResult of firstPull as list
on error
set item i of jobNumRange to {""}
end try
end repeat
set value of range ("A1:A" & z) to jobNumRange
This secret to making this work was coercing the result of regexp into a list.
Thanks for helping me work through this problem!
-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