You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Apple Script结合Automator工作流实现截图+时间发送至iMessage好友?

Automator + Apple Script: Send Screenshot with Timestamp via iMessage

Hey there! I've got a straightforward solution to tie your existing screenshot Automator workflow to sending that screenshot (plus a timestamp) to a specific iMessage buddy using AppleScript. Here's how to set it up:

Step 1: Update Your Automator Workflow

  • Open your existing "Take ScreenShot" Automator workflow.
  • Scroll to the bottom of your workflow, then search for the Run AppleScript action in the left-side actions library. Drag it into your workflow as the final step.

Step 2: Paste the Custom AppleScript

Replace the default placeholder script in the Run AppleScript action with this code snippet:

-- Generate a human-readable timestamp (adjust format as needed)
set currentTimestamp to do shell script "date '+%Y-%m-%d %H:%M:%S'"
set messageContent to "Screenshot captured at: " & currentTimestamp

-- Replace this with your recipient's phone number or Apple ID
set targetRecipient to "555-123-4567"

-- Pull the screenshot data from your clipboard
set screenshotImage to the clipboard as TIFF picture

-- Send everything via iMessage
tell application "Messages"
    set iMessageService to first service whose service type is iMessage
    set targetBuddy to buddy targetRecipient of iMessageService
    -- Send timestamp message first, then the screenshot
    send messageContent to targetBuddy
    send screenshotImage to targetBuddy
end tell

Important Adjustments to Make

  • Recipient Details: Swap 555-123-4567 with your friend's actual phone number (include country code if they're overseas) or their Apple ID email address.
  • Timestamp Format: If you prefer a different date/time style, tweak the date '+%Y-%m-%d %H:%M:%S' part. For example:
    • '+%m/%d/%Y %I:%M %p' gives you 09/15/2024 02:45 PM
    • '+%A, %B %d, %Y at %H:%M' gives you Sunday, September 15, 2024 at 14:45
  • Permissions: The first time you run this workflow, macOS will prompt you to grant access to Messages and the clipboard. Make sure to allow these permissions—otherwise the script can't send the message or access your screenshot.

How It All Comes Together

  1. Your existing Automator step captures the screen and copies the screenshot to your clipboard.
  2. The AppleScript grabs the current time, formats it into a clear message, then pulls the screenshot from the clipboard.
  3. It opens the Messages app, locates your specified buddy, sends the timestamp message, and follows up with the screenshot attachment.

内容的提问来源于stack exchange,提问作者Tim Apple

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:34:38