In my region, this command produces the following example output where the value of the theDateTimeNow variable would be, e.g.: at 12.04.30 PMīetween the line of code above and the two lines that follow it in the script, they produce, e.g.: Screen Shot at 12.04.30 PM.png You may need to adjust the following line of code for it to be as in your region: set theDateTimeNow to (do shell script "date \"+%Y-%m-%d at %l.%M.%S %p\"") The file naming convention is that of the macOS default for Screen Shots saved normally, in my region. 2 By default, ⇧⌘5 in macOS Mojave is by assigned to a new Screenshot feature, so try ⇧⌘6 instead.1 In macOS Mojave, a Service in Automator is now called a Quick Action, so select that.Now when you press ⇧⌘5 2 the crosshair cursor appears just as though you had pressed ⇧⌘4, however after making the selection as normal and releasing the mouse, the selected area is both copied to the clipboard and saved to a file on the Desktop. Screen Shot to Clipboard and File ⇧⌘5 2.Assign a shortcut, in System Preferences > Keyboard > Shortcuts > Services:.
The following is an example of what I'd do, if I needed both, to place a screen shot on the clipboard and save it as a file at the same time.