Add Subject Line to Email Hyperlink
I'm trying to script the application of a hyperlink to email from a character style. I've managed to make it work for the most part but now I'm at a loss about how to modify the Subject Line in the hyperlink that is created. Any ideas?
var myDoc = app.activeDocument;
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = ".+";
app.findGrepPreferences.appliedCharacterStyle = "Email Hyperlink";
var myFound1 = myDoc.findGrep();
count = 0
for(k=0; k<myFound1.length; k++)
{
try{
var myFind = myFound1
; var myHyperlinkSource = app.activeDocument.hyperlinkTextSources.add(myFound1
); var myHyperlinkURLDestination = app.activeDocument.hyperlinkURLDestinations.add("mailto:"+myFound1
.contents); var myHyperlink = app.activeDocument.hyperlinks.add(myHyperlinkSource, myHyperlinkURLDestination, {name: myFound1
.contents+count++}); count++
}catch(e){}
}
alert(count/2 + " E-Mail Hyperlinks Created");
