संदेश में समय जोड़ने का एक उदाहरण इस प्रकार है:
set theTime to time string of (current date)
tell application "Messages"
set iMessageService to 1st service whose service type = iMessage
set imessagebuddy to buddy "mymessagebuddy@domain.com" of iMessageService
send "Message " & theTime to imessagebuddy
end tell
ओपी में आपने कहा "वर्तमान समय को शामिल करने के लिए" लेकिन आपने अपनी टिप्पणी में "वर्तमान तिथि / समय होने के लिए" कहा है, इसलिए यदि आप उत्तरार्द्ध चाहते हैं, तो इसके बजाय निम्नलिखित उदाहरण का उपयोग करें:
set theDateTime to (current date) as string
tell application "Messages"
set iMessageService to 1st service whose service type = iMessage
set imessagebuddy to buddy "mymessagebuddy@domain.com" of iMessageService
send "Message " & theDateTime to imessagebuddy
end tell
वैसे, यदि आप AppleScript का उपयोग करने की योजना बना रहे हैं, तो यह आपको AppleScript लैंग्वेज गाइड पढ़ने के लिए प्रेरित करेगा । आप इससे प्राप्त कर सकते हैं: स्क्रिप्ट संपादक > सहायता > AppleScript भाषा गाइड दिखाएं
संदर्भ के लिए time string, यह dateAppleScript भाषा गाइड में कक्षा संदर्भ के तहत दिखाया गया है ।
संदर्भ के लिए current date, यह AppleScript भाषा गाइड में Commands Reference के तहत दिखाया गया है।