Voilà,
Utilisation d'une boite de dialogue.
En A2
=SI(REGEXMATCH(A1;"mer")=VRAI; VRAI; "Il n y a pas le mot mer")
Dans app script
SON.html
<!DOCTYPE html>
<html>
<head>
<title>Boite de dialogue son</title>
<style>
input {
display: inline-block;
float: right;
padding: 0.6rem 1rem 0.5rem;
margin-top: 1.5rem;
font-size: 1rem;
background: #e9fdf8;
border: 2px solid #4db699;
border-radius: 0.4rem;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Son</h1>
<audio controls>
<source src="lien_du_mp3" type="audio/mpeg">
</audio>
<input type="button" value="Fermer" onclick="google.script.host.close()">
</body>
</html>
Code.gs
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Sheets-Pratique')
.addItem('Son de la mer', 'son')
.addToUi();
}
function Son() {
const html = HtmlService.createHtmlOutputFromFile('SON')
.setWidth(400)
.setHeight(132);
SpreadsheetApp.getUi().showModalDialog(html, 'Son de la mer');
}
Ajout un déclencheur et c'est bon.
Bonne journée