Just a quick check: Have you used an escape slash for the apostrophe? Are you sure it's an apostrophe (U+0027) and not a right single quotation mark (U+2019); I get them mixed up all the time
Anyhoo, the script here will go over all the layers and replace an apostrophe with an empty string - change the replace string to whatever you want. That should help you along.
// call the source document
var srcDoc = app.activeDocument;
var numOfLayers = srcDoc.layers.length;
// main loop starts here
for (var i = numOfLayers -1; i >= 0; i--)
{
var tempLayer = srcDoc.layers[i]
reName = justGetFontContents(tempLayer);
}//end loop
// function JUST GET FONT CONTENTS (layer)
// --------------------------------------------------------
function justGetFontContents(alayer)
{
if (alayer.kind == 'LayerKind.TEXT')
{
//alert(alayer.name + " " + alayer.textItem.contents)
var c = replaceApostrophe(alayer.textItem.contents)
alert("reName = " + c)
alayer.textItem.contents = c
}
return c
}
// function REPLACE APOSTROPHE WITH NOTHING (text string)
// --------------------------------------------------------
function replaceApostrophe(string)
{
var niceString = string.replace(/[\']/g, "");
return niceString;
}