Try to deal with this script.
My English is not good enough to explain everything in detail to you how it works.
var s = activeDocument.activeLayer.textItem.contents;
var x1 = s.indexOf("Mc");
if (x1 >= 0) set_text_style(x1+1, 1, small_caps);
var x2 = s.indexOf("-");
if (x2 >= 0) set_text_style(x2, 1, set_font);
alert("Done!");
function small_caps(d)
{
d.putEnumerated(stringIDToTypeID("fontCaps"), stringIDToTypeID("fontCaps"), stringIDToTypeID("smallCaps"));
}
function set_font(d)
{
d.putString(stringIDToTypeID("fontPostScriptName"), "ArialMT");
d.putString(stringIDToTypeID("fontName"), "Arial");
}
function set_size(d)
{
d.putUnitDouble(stringIDToTypeID("size"), stringIDToTypeID("pointsUnit"), 50);
}
function set_text_style(from, len, style_modifier)
{
try {
// get textKey descriptor for activeLayer
var r = new ActionReference();
r.putEnumerated(stringIDToTypeID("textLayer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var textKey = executeActionGet(r).getObjectValue(stringIDToTypeID("textKey"));
var list = textKey.getList(stringIDToTypeID("textStyleRange"));
var new_list = new ActionList();
// get styles of each char, modify if needed
var styles = new Array();
var x = 0; // chars counter
for (var i = 0; i < list.count; i++)
{
var d = list.getObjectValue(i);
var x0 = d.getInteger(stringIDToTypeID("from"));
var x1 = d.getInteger(stringIDToTypeID("to"));
var st = d.getObjectValue(stringIDToTypeID("textStyle"));
for (var n = 0; n < x1-x0; n++)
{
if (x >= from && x < from+len) // modify current style
{
var d = new ActionDescriptor();
d.fromStream(st.toStream()); // duplicate style
style_modifier(d); // modify current style
styles.push(d);
}
else
{
styles.push(st);
}
++x;
}
}
styles.push(new ActionDescriptor());
// scan styles, modify if needed, compact to range (from-to)
var from = 0;
for (var i = 0; i < styles.length-1; i++)
{
if (!styles[i].isEqual(styles[i+1]))
{
var d = new ActionDescriptor();
d.putInteger(stringIDToTypeID("from"), from);
d.putInteger(stringIDToTypeID("to"), i+1);
d.putObject(stringIDToTypeID("textStyle"), stringIDToTypeID("textStyle"), styles[i]);
new_list.putObject(stringIDToTypeID("textStyleRange"), d);
from = i+1;
}
}
// put new styles to textKey descriptor
textKey.putList(stringIDToTypeID("textStyleRange"), new_list);
// set modified textKey back to textLayer
var d = new ActionDescriptor();
var r = new ActionReference();
r.putEnumerated(stringIDToTypeID("textLayer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("textLayer"), textKey);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
}
catch (e) { alert(e); }
}