Re: Parsing Strings
Re: Parsing Strings
- Subject: Re: Parsing Strings
- From: Emmanuel <email@hidden>
- Date: Fri, 18 Jan 2008 01:26:22 +0100
At 4:38 PM -0500 1/17/08, Justin Laden wrote:
Emmanuel,
I tried your advice, but came up empty. Could you tell me what I'm
doing wrong?
My code:
repeat with i from 1 to (descriptionRange)
try
--find text "^[a-zA-Z][0-9]{4}" in item i of
descriptionRange with regexp
--copy text "^[a-zA-Z][0-9]{4}" in item i of
descriptionRange with
regexp to item i of jobNumRange
-- found
on error
-- not found
end try
end repeat
I confess that I don't quite remember the exact issue, but:
- the bounds for the loop are not consistent
- all lines are commented, is that how you ran your script?
- I don't know a "copy text etc" command, so every iteration of the
loop will fail into "-- not found".
At first sight, assuming descriptionRange is a list of strings, you want:
repeat with i from 1 to (count descriptionRange)
try
find text "^[a-zA-Z][0-9]{4}" in item i of
descriptionRange with regexp
-- found
on error
-- not found
end try
end repeat
Best,
Emmanuel
_______________________________________________
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