首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Automator mac“截图”问题

Automator mac“截图”问题
EN

Stack Overflow用户
提问于 2011-02-09 07:19:35
回答 2查看 1.6K关注 0票数 0

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

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-07-26 00:19:09

我设法使用了screencapture和date来做类似的事情:

代码语言:javascript
复制
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的流行包装器中。我真的很想知道如何做到这一点,因为我从来没有能够理解鸭嘴兽。

票数 1
EN

Stack Overflow用户

发布于 2013-06-18 06:59:32

我从@user8259获取了答案,并使其更像您通常看到的内置屏幕截图:

代码语言:javascript
复制
# 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”操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4939656

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档