tell application "TextEdit"
tell document 1
get first character of every word whose font is "Helvetica-Bold"
end tell
end tell
And here’s your filtering example, done right, in Node.js[2]: #!/usr/bin/env node
const {app, its} = require('nodeautomation');
const textedit = app('TextEdit');
let doc = textedit.documents[0];
let ref = doc.words.where(its.font.eq('Helvetica-Bold')).characters.first;
console.log(ref.get());
// => [ 'b', 'b', 'k' ]
…
…In case anyone was still wondering why AppleScript is already dead.