List to string conversion

I’m having trouble with this one.

I have a handler that processes stories in InDesign and gives me a list of the stories as text items

The variable is called uniqueInCopyStories and the value of it at the end of the handler is:
{“AZ-CAID-Behavioral HealthWHERE TO GET BEHAVIORAL HEALTH SERVICES IN ARIZONA
MARICOPA
COUNTY
Magellan
Health Services
1-800-564-5465
GILA, LA PAZ, PINAL AND YUMA COUNTIES
Cenpatico
1-866-495-6738
COCHISE, GRAHAM ,
GREENLEE, PIMA AND
SANTA CRUZ COUNTIES
Community Partnership
of Southern Arizona
1-800-771-9889
APACHE, COCONINO,
MOHAVE, NAVAJO
AND YAVAPAI COUNTIES
Northern Arizona
Behavioral Health
1-877-923-1400”, “AZ-CAID_Plans for the future CTA
i WRITE IT DOWN Ask your doctor, clinic or hospital for an advance directive form. Questions? Call Member Services at 1-800-
348-4058 (TTY 1-800-367-8939).”, “AZ-CAID_Emergency CTA
? UNSURE? If you’re not sure what to do, call your PCP. Or, call Member Services at at 1-800-348-4058 (TTY 1-800-367-8939) for advice.”, “AZ-CAID_Drinkingprotect
your baby
If you have HIV, you could pass the virus to your baby during pregnancy, labor or breastfeeding. There are steps you can take to reduce the risk of infecting your baby with HIV. There are medications that may prevent HIV from being passed from mother to baby. Once the baby is born, it is safer for HIV-positive mothers to bottle feed instead of breastfeeding.
If you are pregnant and have HIV, APIPA has a program called Healthy First Steps (HFS) that can help you. HFS case managers can guide you through your pregnancy and postpartum period to help you have a healthy baby.”, "AZ-CAID_Baby be well sidebar
? FIRST STEPS If you need help scheduling an appointment, please
call APIPA at 1-888-664-2777. ", “AZ-CAID_doctor rightFindingdoctor
right
Make your PCP your partner in health
When you joined your health plan, you chose a primary care provider (PCP). Your PCP will provide or coordinate all your health care. If you need tests or treatments that your PCP can’t provide, he or she will give you a referral.
You should feel comfortable with your PCP. If you are not,
contact your health plan to choose a new one. Think about what you want in a PCP. You may prefer a PCP who is male or female. You might want one who speaks your
language or shares your culture. You might want one with weekend hours, or one located near public transportation.
There are different types of doctors who are PCPs. They include:
g _FAMILY PRACTITIONERS treat the whole family. They may also provide women’s health care.
g _INTERNISTS treat adults only.
g _PEDIATRICIANS treat children
from birth through the teen years.
g _OB/GYNs provide women’s health care. Women can choose one in
addition to their PCPs. They
provide birth control and STD testing. They also provide
prenatal care and deliver babies.”, “AZ-CAID_doctor right CTA
? WHAT’S YOUR TYPE? To see a list of participating providers, see
www.myapipa.com. Or call 1-800-348-4058 (TTY 1-800-348-4058 ) to ask
for a provider directory at no cost to you.”, “AZ-CAID_shine arizona CTA
? We’re here Call 1-888-96-SHINE or visit www.ShineArizona.com to learn when, where and who
will be joining Shine Arizona’s Health on Wheels visits in your community. We’re helping ALL Arizonans
Be Healthy, Be Strong, Shine!”, "AZ-CAID_Allergies-Asthma CTA
? BREATHE Easier If you have asthma, APIPA has a case management program that can help you. Call 1-800-348-4058 (TTY 1-800-367-8939) to find out more. Or, ask your PCP to refer you to the APIPA case management program. ", “AZ-CAID_shine arizonashine
arizona
We’re coming to your town
Join us for Shine Arizona’s Health on Wheels Tour, brought to you by Arizona Physicians IPA. Take advantage of no-cost screenings and cooking demonstrations. Test your skills with boxing, bowling, tennis and Dance Dance
Revolution on the Nintendo Wii. Shoot hoops, jump rope, be healthy and much more.”, “AZ-CAID_Protect your baby CTA
? WE CAN HELP APIPA has Level 3 case managers available to answer any of your
questions about HIV. To find out more, call Member Services at 800-348-4058.”}

Okay,
the next part of my script (which I adapted from this site is

set mylist to items 1 thru -1 of uniqueInCopyStories
set {tdl, text item delimiters} to {text item delimiters, return}
set mystring to items 1 thru -1 of mylist as string
set text item delimiters to tdl

this part returns a text string; problem is that only the first two text items are in the string:

"AZ-CAID-Behavioral HealthWHERE TO GET BEHAVIORAL HEALTH SERVICES IN ARIZONA
MARICOPA
COUNTY
Magellan
Health Services
1-800-564-5465
GILA, LA PAZ, PINAL AND YUMA COUNTIES
Cenpatico
1-866-495-6738
COCHISE, GRAHAM ,
GREENLEE, PIMA AND
SANTA CRUZ COUNTIES
Community Partnership
of Southern Arizona
1-800-771-9889
APACHE, COCONINO,
MOHAVE, NAVAJO
AND YAVAPAI COUNTIES
Northern Arizona
Behavioral Health
1-877-923-1400
AZ-CAID_Plans for the future CTA
i WRITE IT DOWN Ask your doctor, clinic or hospital for an advance directive form. Questions? Call Member Services at 1-800-
348-4058 (TTY 1-800-367-8939).
"

Now I made another script that just included the list and the pertinent code

set uniqueStories to {"AZ-CAID-Behavioral HealthWHERE TO GET BEHAVIORAL HEALTH SERVICES IN ARIZONA
MARICOPA 
COUNTY
Magellan 
Health Services
1-800-564-5465
GILA, LA PAZ, PINAL AND YUMA COUNTIES
Cenpatico
1-866-495-6738
COCHISE, GRAHAM ,
GREENLEE, PIMA AND 
SANTA CRUZ COUNTIES
Community Partnership 
of Southern Arizona
1-800-771-9889
APACHE, COCONINO, 
MOHAVE, NAVAJO 
AND YAVAPAI COUNTIES
Northern Arizona 
Behavioral Health
1-877-923-1400", "AZ-CAID_Plans for the future CTA
i WRITE IT DOWN Ask your doctor, clinic or hospital for an advance directive form. Questions? Call Member Services at 1-800-
348-4058 (TTY 1-800-367-8939).", "AZ-CAID_Emergency CTA
? UNSURE? If you're not sure what to do, call your PCP. Or, call Member Services at at 1-800-348-4058 (TTY 1-800-367-8939) for advice.", "AZ-CAID_Drinkingprotect 
your baby
If you have HIV, you could pass the virus to your baby during pregnancy, labor or breastfeeding. There are steps you can take to reduce the risk of infecting your baby with HIV. There are medications that may prevent HIV from being passed from mother to baby. Once the baby is born, it is safer for HIV-positive mothers to bottle feed instead of breastfeeding.
If you are pregnant and have HIV, APIPA has a program called Healthy First Steps (HFS) that can help you. HFS case managers can guide you through your pregnancy and postpartum period to help you have a healthy baby.", "AZ-CAID_Baby be well sidebar
? FIRST STEPS If you need help scheduling an appointment, please 
call APIPA at 1-888-664-2777. ", "AZ-CAID_doctor rightFindingdoctor    
 right
Make your PCP your partner in health
When you joined your health plan, you chose a primary care provider (PCP). Your PCP will provide or coordinate all your health care. If you need tests or treatments that your PCP can't provide, he or she will give you a referral. 
You should feel comfortable with your PCP. If you are not, 
contact your health plan to choose a new one. Think about what you want in a PCP. You may prefer a PCP who is male or female. You might want one who speaks your 
language or shares your culture. You might want one with weekend hours, or one located near public transportation.
There are different types of doctors who are PCPs. They include:
g _FAMILY PRACTITIONERS treat the whole family. They may also provide women's health care. 
g _INTERNISTS treat adults only. 
g _PEDIATRICIANS treat children 
from birth through the teen years. 
g _OB/GYNs provide women's health care. Women can choose one in
 addition to their PCPs. They 
provide birth control and STD testing. They also provide 
prenatal care and deliver babies.", "AZ-CAID_doctor right CTA
? WHAT'S YOUR TYPE? To see a list of participating providers, see 
[url=http://www.myapipa.com]www.myapipa.com[/url]. Or call 1-800-348-4058 (TTY 1-800-348-4058 ) to ask 
for a provider directory at no cost to you.", "AZ-CAID_shine arizona CTA
? We're here Call 1-888-96-SHINE or visit [url=http://www.ShineArizona.com]www.ShineArizona.com[/url] to learn when, where and who 
will be joining Shine Arizona's Health on Wheels visits in your community. We're helping ALL Arizonans 
Be Healthy, Be Strong, Shine!", "AZ-CAID_Allergies-Asthma CTA
? BREATHE Easier If you have asthma, APIPA has a case management program that can help you. Call 1-800-348-4058 (TTY 1-800-367-8939) to find out more. Or, ask your PCP to refer you to the APIPA case management program. ", "AZ-CAID_shine arizonashine 
arizona
We're coming to your town
Join us for Shine Arizona's Health on Wheels Tour, brought to you by Arizona Physicians IPA. Take advantage of no-cost screenings and cooking demonstrations. Test your skills with boxing, bowling, tennis and Dance Dance 
Revolution on the Nintendo Wii. Shoot hoops, jump rope, be healthy and much more.", "AZ-CAID_Protect your baby CTA
? WE CAN HELP APIPA has Level 3 case managers available to answer any of your 
questions about HIV. To find out more, call Member Services at 800-348-4058."}

set {tdl, text item delimiters} to {text item delimiters, return}
set mystring to items 1 thru -1 of uniqueStories as string
set text item delimiters to tdl

mystring

and this does return every text item (in other words the code works fine).

Does anyone know why my first script is only returning two text items as a string, while the other script is doing correctly what I want the first script to do.

Sorry for the length. Please help!

just set the myString to MyList as string, no need for the item count unless you want to omit one.

set myList to {"a", "b", "c"}
set {tdl, text item delimiters} to {text item delimiters, return}
set myString to myList as string
set text item delimiters to tdl
return myString

Hi Jerome,

Actually that was part of my original code, but that did not work either (or gave me the same --wrong-- result.)

I’m wondering if all else is equal, if the problem isn’t in the system, and not in the code.

I don’t know if it’s what’s happened in your case, but it’s what you’d expect to see if the third value in the list were something that couldn’t be directly coerced to text as part of a list coercion, such as a reference or a record.