Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.3: Use new say command for easy Terminal speech' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Use new say command for easy Terminal speech
Authored by: Lectrick on Nov 21, '03 04:31:29AM
I added some security, and timestamped logging, in case you miss the performance. (Make sure the Unix permissions on the log directory are appropriate!) I am a php newbie ;) Now time for bed!
----------------------

<html><body>
<form method="post">
        Make my Mac say: <input type="text" name="text" size="40">
        <input type="submit">
</form>
</body></html>

<?php
if (isset($_POST['text'])) {
		$s = escapeshellcmd($_POST['text']);
		system("say \"$s\"");
		$fp = fopen("/Path/to/log/file.txt","a");
		fwrite($fp,date("d M Y h:i:s A")."\t".$s."\n");
		fclose($fp);
}
?>

---
In /dev/null, no one can hear you scream

[ Reply to This | # ]