【问题标题】:Automator mac "Take Screenshot" issueAutomator mac“截图”问题
【发布时间】:2013-06-18 06:59:31
【问题描述】:

我需要自动执行截屏任务,所以我想为什么不使用 automator?我找到了“截屏”动作并开始使用它。问题是它设置了文件名,当再次运行工作流时,它会覆盖之前的屏幕截图。我尝试选择它并重命名它,但它不起作用。本质上,我想要的是 command + shift + 3 的正常功能,它会在它上面加上日期标记或其他东西,除了覆盖之外的任何东西!有什么想法吗?

【问题讨论】:

  • 这可能更适合 apple.stackexchange.com

标签: automator


【解决方案1】:

我设法使用截屏和日期来做类似的事情:

fdate=$(date +"$m$d$Y") #I formatted time as mmddyyyy. You can use other formats, add dashes, etc.
screencapture -iW ~/$fdate.png   #outputs file at ~/mmddyyyy.png

或类似的东西。您可以将其包装到 shell 工作流程中,或者将其放入流行的 OSX 包装器 Platypus 中。我真的很想知道如何做到这一点,因为我一直无法理解鸭嘴兽。

【讨论】:

    【解决方案2】:

    我从@user8259 那里得到了答案,并使它更像您通常看到的内置屏幕截图:

    # We'll use the default format for the time-stamp
    # This could be improved to be more like the Mac's built-in
    # screen-shot with yyyy-mm-dd at hh.mm.ss AM/PM
    # you would just have to figure out the date-time formatting
    # in this shell script.
    theTime=`date`
    
    # create the file name for the screen-shot
    theFileName="$HOME/Desktop/Screenshot $theTime.png"
    
    #outputs file on the Desktop with a timestamp
    screencapture "${theFileName}"
    

    我的代码版本除了日期戳之外还包括一个时间戳,以降低屏幕截图覆盖以前的屏幕截图的可能性。

    您可以将此代码添加到名为“Run Shell Script”操作的 Automator 操作中,而不是使用“Take Screenshot”操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-16
      • 2021-01-16
      • 1970-01-01
      • 1970-01-01
      • 2019-05-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多