Search code examples
automator

Automator mac "Take Screenshot" issue


I need to automate a screenshot task, so I thought why not use automator? I found the "Take Screenshot" Action and started to play with it. The problem is is that is sets the file name and when the workflow is ran again it overwrites the prior screenshot. I tried selecting this and renaming it but it wont work. Essentially what I want is the normal function of command + shift + 3 where it will date-stamp it or something, anything but overwrite!! Any ideas?


Solution

  • I managed to use screencapture and date to do something similar:

    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
    

    or something like that. You could wrap this into a shell workflow, or put it in the popular wrapper for OSX, Platypus. I'd seriously like to know how to do that, since I've never been able to understand Platypus.