0

I would like to automate the filing of screenshots according to which application window was front most when taking a screenshot. I would like to do a hazel rule but I do not have the information of which app was in front when taking the screenshot. Any ideas about application or script?

thank you very much Hubertus

6
  • What have you done so far? Please add that to your question. Also macOS itself is what took the screen shot not the app itself. Was that a typo? Jun 29 '20 at 13:46
  • I changed the typo. Actually I do not advance, as I have no clue how to get the information I want. There is no EXIF info or Finder comment about the active application when taking the screen shot
    – hubertus
    Jun 29 '20 at 18:03
  • I would imagine this could be done in Applescript, a subject I know next to nothing about. But I am not surprised that the screen capture has no info about what is on the screen as it is just a picture of any and all open applications. The Mac doesn't care what the applications are it just takes a picture. You may want to look for Applescript specific discussions/websites and see if you can find someone who is working on this issue, solved it or can assist. Note that the AD community has Applescript experience (not me tho...) but is not going to write it for you... Jun 29 '20 at 19:39
  • As a general rule it's not the frontmost app that takes the screenshot and the taking there of are thru global system keyboard shortcuts, and doesn't know or care which app is frontmost. I do not have Hazel, so I can't help you there. That said, as mentioned by Steve Chambers, here is a line of AppleScript code that will get the name of the frontmost app, placing it in the appName variable for you to work with further with some additional AppleScript code: tell application "System Events" to set appName to name of (first process whose frontmost is true) Jun 29 '20 at 23:06
  • ok that was the solution. I wrote an automator action containing an applescript to get the app name. Automator steps to save it in a variable, make a screenshot and rename this screenshot with app name and date. thanks a lot
    – hubertus
    Jun 30 '20 at 5:28

You must log in to answer this question.

Browse other questions tagged .