Pasting screenshots into Gmail with Safari Browser - macos

I often have a need to grab a screen shot of something on my screen (Since I am using OSX, I use the Command+Control+Shift+4 combination, which puts the screenshot into the clipboard). This works well, and allows me to paste into MS Word and other programs.
At some point I had an issue pasting into MS One Note (still on OSX), (I was not able to, when doing Command+V, nothing would paste), which I was able to solve researching online, by changing the default image type for screenshots (I think it was from JPG to PNG, using a command in the OSX terminal).
While this worked for MS One Note, it never helped with pasting into Gmail in Safari (note that I have no issues doing this in Google Chrome).
Can anyone help with how to get pasting images from the clipboard into Gmail when using the Safari Browser? (note I am using the latest OSX and Safari versions available).
Thanks!

I have never tried using the Command+Control+Shift+4 combination but this is what I usually use and it works perfectly for me.
Task 1;
to copy the screen capture to the clipboard so you can use Command+V to paste in any program of your choice
Open your terminal
Type this "screencapture -c" in the terminal without the quotes e.g.: screencapture -c
open any program of your choice and press Command+V to paste.
Task 2;
To screen capture your computer screen and save the file directly to a png or jpg and later insert or attach it to any program of your choice
Open your terminal
type this "screencapture ./Location/filename.ext" in the terminal without the quotes e.g.: screencapture ./Desktop/myCapture.jpg This will save the capture file on the desktop with the jpg format.
to get more information about the command, type "screencapture --h" in your terminal without the quotes.

Related

How do I preserve PDcurses output in a Windows Console window after executable completes?

I'm writing an application for Windows 10 to display and update text at specific locations in a Windows console window. The program is launched by a command in the console window. Upon launch, it erases the window's previous contents, then displays its output, updating as it goes, until completion. Upon exit, it should leave the displayed output in place, and a new command prompt should appear below. Launch, display, and subsequent command prompt all occur in the same console window. (Old school, I know, but that's the requirement.) The program is written in C and uses calls to the PDcurses library to control cursor placement and to output display text to the screen. The application is built with GCC/MinGW on a Windows 10 platform.
Everything works until the application exits, but then the display output disappears and the previous window contents (from before the app was launched) reappear. From what I can tell, this seems to be the default behavior for curses, possibly due to the way it handles screen buffering.
I'm looking for ways to override this behavior, but I'm not sure how to approach it. Can I direct PDcurses to write to the standard screen buffer rather than the alternate screen buffer (if that's what's going on)? If so, how? Should I copy the contents of the screen buffer before I call endwin(), then copy those contents back to the screen buffer afterward? Again, how? I'm sure this problem has already been solved, probably many times, but I haven't found any solutions that seem to apply to a C executable running in a Windows console, and I have only limited experience with PDcurses and the Windows API library. Any help would be appreciated.
The official way to do it is to set an environment variable: set PDC_RESTORE_SCREEN=0. You can combine this with set PDC_PRESERVE_SCREEN=Y to prevent PDCurses from clearing the screen at startup.

Screen capture without user interaction

I'm building an app that needs to be able to take intermittent screen captures of a target window while running in the background. That is, it needs to be able to screenshot a specific window without user interaction.
Say for example I have Photoshop open, I'd like to capture a screenshot of my open Photoshop document every few minutes and save the capture to a file, essentially building a visual history of how the document has changed over time.
Currently I'm searching for a Unix/Mac solution but Window's suggestions are warmly welcomed.
Screencapture & Scrot both require mouse interaction to target a window & from what I've researched Imagemagick requires xwd to launch to get the id of the target window.
I'm looking for a lightweight solution (that I can bundle with my software) or ideally a solution already built into the OS to accomplish this.
Any suggestions would be very much appreciated. Cheers.
xwd utility can dump particular X11 window content. It accepts window ID to dump as an argument and can be used in non-interactive mode.
To capture the whole X-desktop on any unix/linux non-interactively you can call:
xwd -root > file
To display the dump:
xwud -in file

Firefox: BitmapData Handle?

I have heard that it is possible to get a bitmap/image handle of the webpage being viewed on a firefox browser. I have been researching for a bit and couldn't not find anything.
So I am hoping if anyone knows how to do this, preferable via the command line (bash, any other shell on Linux).
To be honest, any browser that I could do this on is fine as long as its simple and on the shell!
Thanks all
Just one option: ImageMagick has an import command that will take a screenshot of any (X server) window from the command line. If you don't want the entire window you can specify a cropping area.

Unable to use Screen's clipboard inside Firefox

I have not managed to get my pbcopy/pbpaste to work in Screen as discussed here.
I aim to solve the problem by having Screen clipboard inside Firefox.
Its paste works in terminal by the following command but not in Firefox
C-a ]
How can you use Screen's clipboard inside Firefox?
Here's a solution that makes use of screen's buffer-writing commands and pbcopy:
Copying the GNU screen buffer to the Leopard clipboard
Screen's clipboard (correctly called a paste buffer) only works inside that instance of screen. That's all it's designed to do.
The best way to copy-n-paste to FireFox is to use your terminal program's copy mechanism.

Unable to use X clipboard in Screen

I read the following code in Unix Power Tools on page 117
*VT100.Translations: #override\
Button1 <Btn3Down>: select-end(primary,CUT_BUFFER0,CLIPBOARD)\n\
!Shift <Btn2Up>: insert-selection(CLIPBOARD)\n\
~Shift ~Ctrl ~Meta <Btn2Up>: insert-selection(primary,CUT_BUFFER0)
I have not managed to see any effect of the above code.
How can you use X clipboard in Screen, without your mouse?
Using the mouse. Left-click drag to select and usually the middle mouse button pastes but some terminals may differ (PuTTY uses right-click). If you only have two buttons you click them both together (left mouse button + right mouse button).
In reply to comment below ("Can you do it without your mouse?"):
ctrl-insert : copy
shift-insert : paste
shift-delete : cut
shift-ctrl-C : copy
shift-ctrl-V : paste
Not all applications will support the last three (though Konsole does). In fact most console applications will not allow you to delete text once it's printed.
As far as selecting text without a mouse I'm not sure there's a generic mechanism for that. It's probably terminal and/or application specific (ie, vim has it's own keys for marking and copying text - but only within vim). You could do it with mouse emulation but I'm sure that would be a painful process.
You can't use the traditional Mac/Windows shortcuts in a terminal because they were reserved for different actions long before these OS existed (ie, Ctrl-C terminates the running process).
I'm trying to use Ctrl-C in X
X does not handle these operations directly, they are handled by the application. That's why modern GUI programs like Firefox or Gedit support Ctrl-C for copy but terminals and command-line programs generally do not. As I said, it's a conflict in established conventions and Ctrl-C for kill got in first.
BTW, you could do some key-remapping if it drives you nuts but then you would be learning bad habits when you use a different machine. Best to just get used to it or do most of your editing in a GUI application.
More Information
EDIT: For a Mac, this may help: MacOSX-to-Konsole or This or This. It looks like you need to replace Ctrl with Command on Mac keyboards. It seems like Terminal the mac console has a right-click context menu for copy-paste so to do it the traditional way you me need to install a different console program or change some settings in Terminal.

Resources