Hi,
this is a JavaScript that should displays a pop-up menu (countries of the world, in French language) but when I validate it the console always answer : SyntaxError: unterminated string literal
1:
I cannot found what is wrong, can someone helps me?
Here is my code:
var reply = app.popUpMenu(["A","AFGHANISTAN","AFRIQUE DU SUD","ÅLAND, ÎLES","ALBANIE","ALGÉRIE","ALLEMAGNE","ANDORRE","ANGOLA","ANGUILLA","ANTARCTIQUE","ANTIGUA-ET-BARBUDA","ARABIE SAOUDITE","ARGENTINE","ARMÉNIE","ARUBA","AUSTRALIE","AUTRICHE","AZERBAÏDJAN"],["B","BAHAMAS","BAHREÏN","BANGLADESH","BARBADE","BÉLARUS","BELGIQUE","BELIZE","BÉNIN","BERMUDES","BHOUTAN","BOLIVIE, l’ÉTAT PLURINATIONAL DE","BONAIRE, SAINT-EUSTACHE ET SABA","BOSNIE-HERZÉGOVINE","BOTSWANA","BOUVET, ÎLE","BRÉSIL","BRUNEI DARUSSALAM","BULGARIE","BURKINA FASO","BURUNDI"],["C","CAÏMANS, ÎLES","CAMBODGE","CAMEROUN","CANADA","CAP-VERT","CENTRAFRICAINE, RÉPUBLIQUE","CHILI","CHINE","CHRISTMAS, ÎLE","CHYPRE","COCOS, ÎLES","COLOMBIE","COMORES","CONGO","CONGO, LA RÉPUBLIQUE DÉMOCRATIQUE DU","COOK, ÎLES","CORÉE, RÉPUBLIQUE DE","CORÉE, RÉPUBLIQUE POPULAIRE DÉMOCRATIQUE DE","COSTA RICA","CÔTE D’IVOIRE","CROATIE","CUBA","CURAÇAO"],["D","DANEMARK","DJIBOUTI","DOMINICAINE, RÉPUBLIQUE","DOMINIQUE"],["E","ÉGYPTE","EL SALVADOR","ÉMIRATS ARABES UNIS","ÉQUATEUR","ÉRYTHRÉE","ESPAGNE","ESTONIE","ÉTATS-UNIS","ÉTHIOPIE"],["F","FALKLAND, ÎLES ","FÉROÉ, ÎLES","FIDJI","FINLANDE","FRANCE"],["G","GABON","GAMBIE","GÉORGIE","GÉORGIE-DU-SUD ET LES ÎLES SANDWICH DU SUD","GHANA","GIBRALTAR","GRÈCE","GRENADE","GROENLAND","GUADELOUPE","GUAM","GUATEMALA","GUERNESEY","GUINÉE","GUINÉE-BISSAU","GUINÉE ÉQUATORIALE","GUYANA","GUYANE FRANÇAISE"],["H","HAÏTI","HEARD-ET-ÎLES MACDONALD, ÎLE","HONDURAS","HONG-KONG","HONGRIE"],["I","ÎLE DE MAN","ÎLES MINEURES ÉLOIGNÉES DES ÉTATS-UNIS","ÎLES VIERGES - UK","ÎLES VIERGES - USA","INDE","INDONÉSIE","IRAN, RÉPUBLIQUE ISLAMIQUE D’","IRAQ","IRLANDE","ISLANDE","ISRAËL","ITALIE"],["J","JAMAÏQUE","JAPON","JERSEY","JORDANIE"],["K","KAZAKHSTAN","KENYA","KIRGHIZISTAN","KIRIBATI","KOWEÏT"],["L","LAOS, RÉPUBLIQUE DÉMOCRATIQUE POPULAIRE","LESOTHO","LETTONIE","LIBAN","LIBÉRIA","LIBYENNE, JAMAHIRIYA ARABE","LIECHTENSTEIN","LITUANIE","LUXEMBOURG"],["M","MACAO","MACÉDOINE, L’EX-RÉPUBLIQUE YOUGOSLAVE DE","MADAGASCAR","MALAISIE","MALAWI","MALDIVES","MALI","MALTE","MARIANNES DU NORD, ÎLES","MAROC","MARSHALL, ÎLES","MARTINIQUE","MAURICE","MAURITANIE","MAYOTTE","MEXIQUE","MICRONÉSIE, ÉTATS FÉDÉRÉS DE","MOLDOVA, RÉPUBLIQUE DE","MONACO","MONGOLIE","MONTÉNÉGRO","MONTSERRAT","MOZAMBIQUE","MYANMAR"],["N","NAMIBIE","NAURU","NÉPAL","NICARAGUA","NIGER","NIGÉRIA","NIUÉ","NORFOLK, ÎLE","NORVÈGE","NOUVELLE-CALÉDONIE","NOUVELLE-ZÉLANDE"],["O","OCÉAN INDIEN, TERRITOIRE BRITANNIQUE DE L’","OMAN","OUGANDA","OUZBÉKISTAN"],["P","PAKISTAN","PALAOS","PALESTINIEN, TERRITOIRE OCCUPÉ","PANAMA","PAPOUASIE-NOUVELLE-GUINÉE","PARAGUAY","PAYS-BAS","PÉROU","PHILIPPINES","PITCAIRN","POLOGNE","POLYNÉSIE FRANÇAISE","PORTO RICO","PORTUGAL"],["Q","QATAR"],["R","RÉUNION","ROUMANIE","ROYAUME-UNI","RUSSIE, FÉDÉRATION DE","RWANDA"],["S","SAHARA OCCIDENTAL","SAINT-BARTHÉLEMY","SAINTE-HÉLÈNE, ASCENSION ET TRISTAN DA CUNHA","SAINTE-LUCIE","SAINT-KITTS ET NEVIS","SAINT-MARIN","SAINT-MARTIN - FR","SAINT-MARTIN - NL","SAINT-PIERRE-ET-MIQUELON","SAINT-SIÈGE - ÉTAT DE LA CITÉ DU VATICAN","SAINT-VINCENT ET LES GRENADINES","SALOMON, ÎLES","SAMOA","SAMOA AMÉRICAINES","SAO TOMÉ-ET-PRINCIPE","SÉNÉGAL","SERBIE","SEYCHELLES","SIERRA LEONE","SINGAPOUR","SLOVAQUIE","SLOVÉNIE","SOMALIE","SOUDAN","SOUDAN DU SUD","SRI LANKA","SUÈDE","SUISSE","SURINAME","SVALBARD ET ÎLE JAN MAYEN","SWAZILAND","SYRIENNE, RÉPUBLIQUE ARABE"],["T","TADJIKISTAN","TAÏWAN, PROVINCE DE CHINE","TANZANIE, RÉPUBLIQUE-UNIE DE","TCHAD","TCHÈQUE, RÉPUBLIQUE","TERRES AUSTRALES FRANÇAISES","THAÏLANDE","TIMOR-LESTE","TOGO","TOKELAU","TONGA","TRINITÉ-ET-TOBAGO","TUNISIE","TURKMÉNISTAN","TURKS-ET-CAÏCOS, ÎLES","TURQUIE","TUVALU"],["U","UKRAINE","URUGUAY"],["V","VANUATU","VÉNÉZUELA, RÉPUBLIQUE BOLIVARIENNE DU","VIET NAM"],["W","WALLIS ET FUTUNA"],["Y","YÉMEN"],["Z","ZAMBIE","ZIMBABWE"]);
if (reply!=null) {event.target.value = reply;}
My guess is that at some point you've used a non-standard quotes (probably because you're using the French keyboard settings), and Acrobat does not like that.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com