Applications

Crop Custom Part or as PNG to Desktop with cmd+shift+4 OR cmd+shift+3 for FULL Screenshot

 

<Clippy> OS X? pfft, how can I print full desktop screen prints like in Windows?

<Clippy> What’s the Mac/OS X alternative to the clumsy prnt-scrn (print screen) > paste > MS Paint > save > name and format (oops, saved as useless .bmp again?) > find the file (and possibly resize it if you forgot the first time around) > use file > delete > possibly repeat enter process > or clear clipboard if Windows is feeling sluggish, even if the perceived latency or load is purely psychological. Nothing subjective matters when your brain is subjectively seventeen times slower than “real” time.

Snippet of Desktop Screen Instantly Automatically Saves to BG

Shortcut to Crop Rectangle &  Save PNG to Desktop (or change default location/format)

The shortcuts use any combination of the left and right command/shift keys and either the number 3 (full screenprint) or 4 (crop rectangular area) If you want to workout your fingers, use use leftCommand + leftShift + rightCommand + rightShift + 3 (or 4)). Here’s the result, two screenshots,

In Mac OS X (From Yosemite to Maverick to Snow Leopard to Lion, etc)*, you can crop any part of any screen on any monitor you have running, anytime by using Command + Shift + 4 and check the desktop for a new image. (It helps to have it sorted by Date Modified)

Use Command + Shift + 3

and check the desktop for the new image(s).

Unclutted Your Desktop (Change location and format of stored shots/prints

Soon your desktop will look like this:

changing filename screenshot mac os x yosemite

Change Prefix of Default Screenshot Name Saved to Desktop

defaults write com.apple.screencapture name “___ss” && killall SystemUIServer

Restore name to default “Screen Shot” prefix

defaults write com.apple.screencapture name "Screen Shot" && killall SystemUIServer

WTF is a command or “defaults” anyway? The command line structure and syntax, dissected and easy to visualize.

Change Where Captured Shots Instantly Get Saved In

Instruct, invoke, run, execute, call the defaults cmd, which like most commands isjust the name of an app your Terminal.app (make sure it's open!, use SpotLight) or iTerm or other terminal emu or shell is aware of (technically it exists in your shell's $PATH variable) (usually) should write 3 underscores as a prefix to shots stored in ~/Pictures/Screenshots

Change the Format of the Saved Screenshot to JPG, TIFF, PDF, GIF or default PNG

defaults write com.apple.screencapture type jpg
defaults write com.apple.screencapture type tiff
defaults write com.apple.screencapture type pdf
defaults write com.apple.screencapture type gif
defaults write com.apple.screencapture type png

*pro tip: To avoid repetition in documentation and tutorials, we can put all choices between square [ brackets ] and delimit or separate each choice with a vertical pipe |. The result is [only|one|of|these|words|not|all]. The above 5 calls to default can be abbreviated, ie in their man/documentation pages as:

defaults write com.apple.screencapture type [png|tiff|jpg|pdf|gif]

though typing all of this out would be invalid. You just have to learn that a pipe | is an OR, as you agreed that in literature (or major languages) an ampersand & is an AND. Just remember it.

Read current format Images get Saved As

defaults read com.apple.screencapture

Tip: This is how you read any of these “OS X user defaults”. The Command Line Explained in Detail. To see the documentation, type

man defaults

in the Terminal/iTerm/shell/Bash/Zsh and hit enter to read the manual page. press q or Q to quit and the UP arrow to cycle through the last commands you ran in descending order.

 

Troubleshooting / Screenshot shortcut doesn’t work?

It’s the number 4, not F4, ensure exclusively three keys held. If you can’t locate the images, open up Finder (Command + Space, type finder and press Return when it’s found (usually by the 3rd letter, ‘fin’. Typing nothing else and waiting will drop down mixed results. )

* You can do this in Microsoft Windows 7, Windows 8 or above by using the included SnipperTool.exe (type it into the Start > Search bar, then create a shortcut to it on your Start Bar and/or create a universal shortcut for it. and in Linux and other versions of Mac or Windows (XP, Vista, etc) using third party apps or browser extensions if you’re only interested in grabbing screen captures/crops within your browser.

Live Markdown Preview in Any Editor Using Marko.app

markdown mou.app alternative marko os x live preview vim webstorm

Marko (free) from the App Store (unrelated to an app with the same name by Marko Labs) finally fulfilled all my requirements to replace my previous Markdown editor Mou. Unlike Mou which tries to do too much and essentially is not meant to be integrated into other apps, Marko does one thing and does it well. It has excellent GitHub flavored Markdown support and it works by simply watching a Markdown file for changes you make in any external editor (my favorites are vim and WebStorm.)

Usage

Open Marko.app, then the markdown. You will see the parsed preview. Now in your editor open that markdown file and edit while Marko sits and updates live.

Command-line Usage

open -a /Applications/Marko.app ~/project/README.md

I created a console script /usr/local/bin/marko

  • Simply create that file: touch /usr/local/bin/marko
  • Give it executable permission: chmod a+x /usr/local/bin/marko
    and paste:
#!/bin/bash
open -n -a /Applications/Marko.app "$@"


(the -n here is to open a new syntax even if one exists. just a personal preference.)

Integration into JetBrains’ suite of apps

To add Marko as an External Tool to WebStorm, open preferences in WebStorm or the other JetBrain IDEs (PHPStorm, RubyMine, etc.) and under External Tools, add it with these options:

  • External Tool to execute: open
  • with the following args: -n -a /Applications/Marko.app $FilePath$

Screenshot makes this easier to understand:

markdown mou.app alternative marko os x live preview vim webstorm

To simplify this, you can create a marko script (see above) and use that in place of “open” in the external tool option and pass $FilePath$ as the argument.

Search file contents with ag—Silver Searcher, Faster than ack and grep

If you use ack or grep to search within files, check out The Silver Searcher (ag).

Installation is easy with homebrew. Open up a terminal and hit:

brew update && brew upgrade

if you haven’t updated in awhile, then to install ag:

brew install the_silver_searcher

when it’s done, type ag -h to see the options. Usage is very similar to ack/grep.

Example, let’s search every app in /Applications for curse words:

ag --stats --all-text --hidden --stats --column --context=0 -i "[^a-z]+?(asshole|whore|slut|cock|douche|faggot|fuck|shit)[^-a-z]" /Applications

outputs..


  $ ...  

  REAPER64.app/Contents/InstallFiles/Effects/LOSER/masterLimiter
   59:77:// Prevent From Preopening, I Know There Might Be Transients In Between, But Fuck'Em :/

  REAPER64.app/Contents/InstallFiles/Effects/Utility/KanakaMS5
   20:63:// so realistically this happens once or when the user changes shit.

  REAPER64.app/Contents/InstallFiles/Effects/Utility/KanakaMSEncoder1
   16:63:// so realistically this happens once or when the user changes shit.

  RubyMine.app/rb/testing/patch/bdd/teamcity/spec/runner/formatter/teamcity/formatter.rb
   435:19:            # Holy shit!!! ----> in ruby 1.8.x "instance_methods" returns collection of string and in   1.9.x collection of symbols!

  Steam.app/Contents/MacOS/tenfoot/resource/localization/tenfoot_swedish.txt
   661:36:"Checkout_Sentiment_OverOut"	"Klart slut"

  Vagrant/embedded/lib/ruby/1.9.1/rubygems/indexer.rb
   350:15:        # HACK: fuck this shit - borks all tests that use pl1

  30 matches
  23210 files searched
  229088848 bytes searched
  34.794926 seconds
$

Running IETester on Mac OS X (Convert EXE to DMG)

Wineskin creates a “wrapper” around a Windows executable file. This wrapper encloses the executable into a specific environment. The .app file (wrapper) simply executes the EXE using `wine`

This example was tested on Mac OS X Lion 10.8.4 and Wineskin Winery 1.7

Testing IE on Mac without installing Windows or using Bootcamp of Parallel.

Download Wineskin Winery, download IETester.exe Install Wineskin Winery (and an engine for it. More details to come, this is WIP)

Create a Winery wrapper and give it a name like IETester.app (If it demands a file, give it IETester.exe)

Screen Shot 2013-08-27 at 2.27.59 PM

 

When the wrapper is done, open the app file and choose “Install software” and from there, find the IETester.exe you had downloaded earlier.

Screen Shot 2013-08-27 at 2.37.19 PM

 

After the installation, Winery will let you know where the IETester.app was generated. In my case, it was in ~/Applications/Wineskin/

Screen Shot 2013-08-27 at 2.34.48 PM

Screen Shot 2013-08-27 at 2.36.21 PM

Now you can run any EXE within the installed app, see picture below.

Testing IE7, IE8, IE9, IE10 on OS X without having Windows

 

If you’re very interested in getting a piece of Windows-only software to run on Mac OS X, consider CrossOver Office, wine itself and many others available.

Learn and Begin Using Markdown in 30 Minutes

Markdown, RedCarpet, Markup Language, OS X, Kramdown, Markdown Editor, Viewer, md file, mkd file, .markdown file

Markdown is a very useful tool for note takers, list makers, writers, bloggers, content architects, developers, … Markdown is essentially a common dialect for note taking. It is very close to how most of us take notes of any kind. Applying a standardized format to your static plain text content means your otherwise arbitrary notes, todo lists and essays are now formatted in a ‘markup’ language that is widely adopted and very simple to pick up and begin using right away. This means that machines now recognize elements of your content and can apply styling and other useful features.

Markdown essentially  s l i c e s  a document into a theme or presentation + the actual content. This means that you write your notes exactly the same way, whether you want a concise and structured grocery list or set of tasks for the week, or you’re writing a book that you want to release in 1 or more formats. Your single essay can be put through 3rd party software and automagically rendered as:

  • Printer-friendly HTML readable in any web browser

  • PDF file for distribution and instant accessibility to PDFs are supported

  • .epub or .mobi ebook file for reading on a Kindle or Nook

  • or published as a hardcopy book

Let’s get practical. You’re making a todo list and realize you need to make another section to group very urgent tasks. You want the urgent tasks to stand out, so you add markings and symbols in your writing to convey labeled groups of tasks. In a text document, you may add 2 empty lines to separate a group and put a line (—–) between a group name and it’s items. Done.

It’s simple. It’s plain text—readable by humans because it looks familiar to how most of us “mark up” our notes by indenting, emphasizing, underline something and using * to denote bullets prefixed to items in a list. And it’s readable by software that can now index, make searchable, add styling and accessibility features (i.e., the file is in a common machine language. I can turn it into a .mobi file to read on my Kindle, or to turn it into an audiobook that has features only possible if you can tell which unit of the file is the title and which is the body of text (like, make an audio Table of Contents.)

UPDATE 12/19/2014: I now use Marko.app over Mou. See my post on Marko and WebStorm integration.

 

Markdown, RedCarpet, Markup Language, OS X, Kramdown, Markdown Editor, Viewer, md file, mkd file, .markdown file

Install Mou – The app features a split screen. The left is where you enter your content, and the right is a live preview of your Markup/HTML content styled using one of the themes in the preferences panel. GitHub, Clearness, Tomorrow, Tomorrow+ and other CSS themes are included. While editing, hit command + R to pull up a concise Markdown Language Syntax reference.

Jeff Atwood describes Markdown accurately:

Markdown is a simple little humane markup language based on time-tested plain text conventions from the last 40 years of computing.

Markdown, RedCarpet, Markup Language, OS X, Kramdown, Markdown Editor, Viewer, md file, mkd file, .markdown file

Mou is a free Mac OS X Markdown Viewer and Editor