2011-02-08 94 views
0

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

+0

这可能更适合apple.stackexchange.com – 2011-02-08 23:22:05

回答

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的流行包装中。我真的很想知道该怎么做,因为我从来没有能够理解鸭嘴兽。

0

我从@ 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}" 

我的代码版本包括除了日期 - 时间标记邮票以使屏幕截图不太可能覆盖先前的屏幕截图。

您可以将此代码添加到称为“运行Shell脚本”操作的Automator操作,而不是使用“执行屏幕快照”操作。