Loading...
Loading...
Compare original and translation side by side
chat.dbautomating-mac-appschat.dbautomating-mac-appsserviceTypeiMessageSMShandlesendMessages.send()serviceTypeiMessageSMShandlesendMessages.send()const Messages = Application('Messages');
Messages.includeStandardAdditions = true;
function safeSend(text, handle, svcType = 'iMessage') {
const svc = Messages.services.whose({ serviceType: svcType })[0];
if (!svc) throw new Error(`Service ${svcType} missing`);
const buddy = svc.buddies.whose({ handle })[0];
if (!buddy) throw new Error(`Buddy ${handle} missing on ${svcType}`);
Messages.send(text, { to: buddy });
}try/catchconst Messages = Application('Messages');
Messages.includeStandardAdditions = true;
function safeSend(text, handle, svcType = 'iMessage') {
const svc = Messages.services.whose({ serviceType: svcType })[0];
if (!svc) throw new Error(`Service ${svcType} missing`);
const buddy = svc.buddies.whose({ handle })[0];
if (!buddy) throw new Error(`Buddy ${handle} missing on ${svcType}`);
Messages.send(text, { to: buddy });
}try/catchreferences/ui-scripting-attachments.mdreferences/ui-scripting-attachments.mdsend()chat.messages()~/Library/Messages/chat.dbchat.dbchat.dbchat.messages()sqlite3 -jsonreferences/database-forensics.mdsqlite3 ~/Library/Messages/chat.db "SELECT
CASE WHEN m.is_from_me = 1 THEN 'Me' ELSE 'Them' END as sender,
m.text,
datetime(m.date/1000000000 + 978307200, 'unixepoch', 'localtime') as date
FROM message m
JOIN handle h ON m.handle_id = h.rowid
WHERE h.id LIKE '%PHONE_NUMBER%'
ORDER BY m.date DESC LIMIT 10;"send()chat.messages()~/Library/Messages/chat.dbchat.dbchat.dbchat.messages()sqlite3 -jsonreferences/database-forensics.mdsqlite3 ~/Library/Messages/chat.db "SELECT
CASE WHEN m.is_from_me = 1 THEN 'Me' ELSE 'Them' END as sender,
m.text,
datetime(m.date/1000000000 + 978307200, 'unixepoch', 'localtime') as date
FROM message m
JOIN handle h ON m.handle_id = h.rowid
WHERE h.id LIKE '%PHONE_NUMBER%'
ORDER BY m.date DESC LIMIT 10;"launchdrowidreferences/monitoring-daemons.mdlaunchdrowidreferences/monitoring-daemons.mdMessages.services.whose({ serviceType: 'iMessage' })[0]svc.buddies.whose({ handle })[0]chat.dbMessages.services.whose({ serviceType: 'iMessage' })[0]svc.buddies.whose({ handle })[0]chat.dbreferences/control-plane.mdreferences/ui-scripting-attachments.mdreferences/database-forensics.mdreferences/monitoring-daemons.mdreferences/control-plane.mdreferences/ui-scripting-attachments.mdreferences/database-forensics.mdreferences/monitoring-daemons.md