(WASHINGTON POST) - Ms Julie Hanahan had just checked into the Citadines Las Ramblas, an apartment hotel along Barcelona's famous La Rambla pedestrian mall, when she heard shouting and sirens.
"People were running by and screaming," says Ms Hanahan, who flew to Barcelona from Chicago earlier in August with her husband and two children to board a Mediterranean cruise.
Only seconds before, a van had ploughed through pedestrians on the tree-lined thoroughfare, killing 13 and injuring 100. Ms Hanahan's daughter watched the aftermath from her hotel balcony. "We were on the back of the hotel, thankfully, so she did not witness the van going by," Ms Hanahan says.
But then she, like many other visitors to a destination hit by a terrorist attack, wondered: "Now what? Do we stay in the hotel?" After a long transatlantic flight, her family was hungry, and the Citadines Las Ramblas didn't offer room service.
Should they call the United States Embassy? Contact their friends at home to let them know they were still alive?
What, exactly, do you do when you're on vacation and terrorists attack?
That's a question experts say you shouldn't ever have to ask, because the answer should be written into your travel plans.
In fact, there are several simple steps you can take to ensure you'll remain safe for the duration of your visit in the event that it is disrupted by a terrorist attack.
It could happen to you, warns Mr Charles Goslin, a retired CIA officer and author of Understanding Personal Security And Risk: A Guide For Business Travellers.
He expects incidents like the Barcelona attack to become more common, as terrorists aim for more soft targets.
"They're going after locations where people congregate in large numbers, such as restaurants and cafes, hotels, resorts, theatres or sports stadiums, or departure areas of an airport," he says.
In the chaos that follows such an incident as the one in Barcelona, or the similar terrorist attack in Nice, France, last summer, it's not always clear what to do.
Ms Wendy Gordon, who was staying at a vacation rental a short walk away from the scene of the Barcelona attack, says she immediately texted her friends and family back in the United States to let them know she was fine. She also used Facebook's "safety check" feature to tell all her online friends that she had survived the attack.
"I didn't even think to contact the embassy until a friend told me that they were asking US citizens to contact them," says Ms Gordon, a publicist who lives in Washington.
She e-mailed the embassy and received a form response with a phone number to call in case of emergency.
Her instincts were good, says Mr Chris Chesak, a spokesman for Redpoint Resolutions, a San Mateo, California, company that offers insurance and extraction services for travellers. The first priority is staying safe, which Ms Gordon did by returning to her rental place and staying there.
"You need to stay as calm as possible, because panicking can make a situation worse and cause poor decision-making," he says. "Stop, assess, and plan your next move to a place of ultimate safety. Then reach out to your local embassy or consulate, as well as loved ones, as you're able."
There's an easier way of communicating with the embassy. Instead of reaching out to the authorities after a terrorist incident, US citizens can enrol in the Smart Traveller Enrolment Programme, or Step, a free service that allows them to register their whereabouts. The State Department automatically sends visitors information about safety conditions in their destination country, contacts them in the event of an emergency and helps friends and family get in touch with them if there is an emergency.
Another key preventive step is proper planning for an attack.
"Prepare before vacationing," says Mr Pete Canavan, a public safety professional and self-defence instructor based in Kingston, Pennsylvania. "You can mentally prepare for your visit abroad by training yourself to research multiple routes out of the area, noting the equivalent of 9-1-1 and looking for entrances and exits when entering buildings or tourist attractions."
He adds that one should avoid large crowds and crowded areas if possible, and "stay on the perimeter".
When you get away, stay away. So says Mr John Iannarelli, a retired FBI special agent and author of How To Spot A Terrorist Before It's Too Late.
"Frequently, terrorists have multiple approaches to an attack," he says. "In Paris, terrorists used guns and then detonated suicide belts. In London, a vehicle was used to ram persons, then the driver jumped out and started attacking others with a knife."
He advises travellers to agree on a meeting place if the group gets separated in the aftermath of an incident.
If you're safe, whom should you call? Experienced travellers recommend adding your travel agent and travel insurance company to your list.
A good agent can find you the fastest way out of town, safely. A great agent may even contact you within minutes of the incident, offering options for getting you back home.
"Travel advisers have extensive networks and access to advanced booking tools that can help you see options and make your next moves faster - faster than you could do on your mobile phone, especially if you're under duress," says Ms Erika Richter, a spokesman for the American Society of Travel Agents, a trade group.
Also, call your travel insurance company. The major travel insurance companies maintain a 24-hour hotline for customers. And they field all kinds of questions, not just those related to your policy. For example, Allianz Global Assistance's hotline can offer guidance for all kinds of issues, from terrorism worries to medical advice if you're in an area with high pollen.
"Every provider will be able to explain your policy's terrorism coverage and may be able to start the claims process immediately," says Ms Carolyn Leckie, a spokesman for Squaremouth, a travel insurance website.
San Francisco engineer Zak Lee, who was in Barcelona during the attack, says he relied on first-hand sources for information - in his case, official communications from law enforcement authorities.
"They're almost all in Catalan or Spanish, so Google Translate has been my friend there," he says.
Social media and English-language media were either unreliable or lagged behind the Spanish news sources.
"I think it's important to take cues from the locals," he adds. "In this case, a lot of the locals seem to be going about normal business, so I'm carrying on with my trip."
That's what Ms Hanahan, who watched the aftermath unfolding from her hotel window, also did.
A hotel representative advised her to stay in the room, and she complied. After things calmed down, she left the safety of her quarters to find food.
"We found a tiny market around the corner that was still open and bought some basics to turn into a make-do dinner in our room," she says.
She boarded her cruise ship without incident and is now vacationing at sea.