I have bash script that creates a screenshot in a given directory saved as an Automator service. I've then assigned ⇪⌘2 from System Preferences > Keyboard > Shortcuts > Services. The problem is that it doesn't work much at all. The only place I've found were it actually runs when using the macro is (how random) when click on the urlbar of Safari, and even then not without inconveniences, as it popups an error message saying "The “Take Screenshot” service could not be used because the “Take Screenshot” workflow did not provide valid data. - Try running the “Take Screenshot” workflow in Automator.", even though the process works fine and the screenshot is indeed captured and saved as intended. What's wrong?
fdate=`date` screencapture "/Users/username/Unorganized/Studio/$fdate.png"