javaolz.blogg.se

Macos screen capture to clipboard
Macos screen capture to clipboard




macos screen capture to clipboard macos screen capture to clipboard macos screen capture to clipboard

This worked, but sometimes would result in the destination application pasting an uncompressed TIFF, which was extremely large. I started by using hs.image and hs.pasteboard in Hammerspoon to read the image and write it to the pasteboard. latestScreenshot end The Tech Details: Copying That Screenshot To the Clipboard file, "creation" ) if ( earliestTimestamp = 0 and string.match ( file, "Screen Shot" )) then earliestTimestamp = creationTimestamp latestScreenshot = file end if (( creationTimestamp > earliestTimestamp ) and string.match ( file, "Screen Shot" )) then earliestTimestamp = creationTimestamp latestScreenshot = file end end return os.getenv ( "HOME" ). dir ( homeDir ) do local creationTimestamp = hs.fs. Since screen shots are always written to the same place, it is straightforward to write some code that looks in that folder (typically your Deskop), and finds the most recent file which contains “Screen Shot” in its name.įor Hammerspoon users, the code looks like this:įunction getLatestScreenshot () local latestScreenshot = "" local earliestTimestamp = 0 local homeDir = os.getenv ( "HOME" ). The Tech Details: Finding the Latest Screenshot

macos screen capture to clipboard

This is fixable with a small amount of scripting, and I have a single global hotkey ( hyper + S) which copies the latest screenshot into the clipboard for easy pasting wherever you need it. Opening Finder, navigating to your Desktop 1, opening the file in Preview, selecting the image, ⌘+C to copy it into my clipboard, switching to the correct destination app, and then finally ⌘+V to paste it takes a while and breaks my flow. You can modify the above shortcut using Control (⌘+Control+Shift+4) to put the screenshot in the clipboard directly, and this works great if you are going to paste it immediately but the process of going back to find the latest screenshot much more manual and laborious. In addition to using it for archival purposes, I use it when messaging and when building presentations to quickly pull material together. The built-in screenshot tool in MacOS (⌘+Shift+4) is really useful to quickly capture a part of your screen.






Macos screen capture to clipboard