Flickerbulb

Chris Corwin is a UX engineer at @salesforce who digs bourbon, beer, bikes, and beef. And pork. Aaand chicken. And asparagus. Food, really.

Get iOS-style “double-spacebar ⇢ period” trick on macOS

For too long I have suffered from the tiny momentary annoyance of typing space space on my Mac keyboard, thinking I will get period + space like I do on iPhone and iPad.

 

How it was in the bad old days

Typing two spaces in a row macOS results in… two two spaces.

In a row.

I won’t rant on it, but, as we learned in 1990, on page 13 of The Mac is not a Typewriter, in modern computing, two spaces in a row is rarely needed, and probably actually Bad™.

Click me to see full sized

What is a contentious nerd to do?

Method 1: Just turn on the macOS native setting.

Turns out there’s a “hidden” (from me, obviously) setting right in the Keyboard → Text preference pane to “Add period with double-space”.

Duh.

Use that: it’s fast and works just like iOS.

Except when it doesn’t, like in “web app” type apps like Slack or anywhere in Chrome and who knows where else.

Which brings us to method 2…

 

 

Method 2: Set up a BetterTouchTool “Custom Key Sequence”

I have used software called BetterTouchTool for small productivity boosts on macOS for years.

It has stupid-configurable window snapping tools, which is why I originally bought it, but it also allows you to allows you to set up custom actions based on mouse or trackpad gestures, gives much finer-grained control over the speed of things like mouse tracking, scrolling, where the touch-sensitive areas of your Magic Mouse are and a million other things.

What I realized this morning was that I can use its custom key sequences to overcome the frustrating lack of being able to hit spacebar twice and get a damn period.

This is a screenshot.

In BetterTouchTool’s preferences (either “Simple” or “Advanced”, doesn’t matter) click the button labeled “ + Add New Shortcut or Key Sequence”.

Choose “Key Sequence” and click the “Record New Key Sequence” button, then hit your spacebar twice.

You’re looking to set up a “predefined action” called “Paste Custom Text”.

The custom text is “period space”, like, you know a period and then a space.

Save that junk and obtain enlightenment.

How it is now

With this BetterTouchTool trick, typing two spaces in a row gets you what it should: a period and then a space.

I mean, we’re not animals.

You’re welcome.

How to minimize windows into their app icon in macOS Sierra


A nice trick from Apple World Today on de-cluttering your dock. 
How to minimize windows into their app icon in macOS Sierra — Apple World Today

post netnewswire item to delicious bookmarks applescript

for blog reading i use the amazing (and free!) software from newsgator called NetNewsWire.

i discovered an applescript for posting post currently being read to my delicious bookmarks.

this was pretty good as it was, but, but i wanted a bit more, so i modified it to prompt for additional tags.

i have also added support for growl notifications, if growl is running.

when you run the script for the first time, it prompts you enter your username, password, and default tags.

you only need to enter that stuff once: after that it just runs.

additionally, i set up a quickilver trigger to run when i push “control + d”, scoped only to NNW.

so, now every time i wish to save whatever it is i am reading in NNW, i just hit “control + d” and it prompts for tags, then runs in the background.

its fast and works great.

to use it yourself, copy the script below and open the Script Editor (included in mac os x).

paste it in, and save it to:

~/Library/Scripts/Applications/NetNewsWire/to read in delicious.scpt

 
property usernamePasswordString : ""
property tagsString : ""
 
on run
	checkUsernameAndPassword()
	postToDelicious()
end run
 
on postToDelicious()
	tell application "NetNewsWire"
		if exists selectedHeadline then
 
			set theResults to display dialog "Enter tags for this item" default answer ""
			if button returned of theResults is "OK" then
				set myTags to text returned of theResults
			end if
 
			set thisHeadline to (title of selectedHeadline)
 
			set u to "\"?&url=" & (URL of selectedHeadline) & ¬
				"&description=" & (title of selectedHeadline) & ¬
				"&tags=" & tagsString & " " & myTags & "\""
			set curlStatement to "/usr/bin/curl -u " & usernamePasswordString & " -d " & u & " https://api.del.icio.us/v1/posts/add"
			set retValue to do shell script curlStatement
			if retValue contains "wrong" then
				display dialog "Headline did not post to Delicious. Something went wrong."
			else
 
 
 
				set the enabledNotificationsList to ¬
					{"Item Posted to Delicious"}
 
				tell application "System Events"
					set growlRunning to ¬
						(count of (every process whose name is "GrowlHelperApp")) > 0
				end tell
 
				if growlRunning then
					tell application "GrowlHelperApp"
 
						register as application ¬
							"scriptNetNewsWire" all notifications enabledNotificationsList ¬
							default notifications enabledNotificationsList ¬
							icon of application "NetNewsWire"
 
						notify with name ¬
							"Item Posted to Delicious" title thisHeadline description "Posted to Delicious with tags: \"" & myTags & ¬
							"\"" application name "scriptNetNewsWire" icon of application "NetNewsWire"
					end tell
				end if
 
			end if
		else
			display dialog "Please select a headline to post to del.icio.us"
		end if
	end tell
end postToDelicious
 
on checkUsernameAndPassword()
	-- Check to see if the file where our username and password are stored exists
	try
		do shell script "cd " & POSIX path of (path to preferences as text) & "; ls | grep com.flickerbulb.toread.txt"
		try
			set prefFile to ((path to preferences as text) & "com.flickerbulb.toread.txt")
			open for access file prefFile with write permission
			set prefs to read file prefFile using delimiter {return}
			close access file prefFile
			set usernamePasswordString to item 1 of prefs
			set tagsString to item 2 of prefs
		on error e
			close access file prefFile
		end try
	on error
		set username to text returned of (display dialog "Please enter your Delicious username" default answer "username")
		set pass to text returned of (display dialog "Please enter your Delicious password" default answer "password")
		set tags to text returned of (display dialog "Please enter any desired default tags" default answer "toread ")
		try
			set prefFile to ((path to preferences as text) & "com.flickerbulb.toread.txt")
			open for access file prefFile with write permission
			set eof of file prefFile to 0
			write username & ":" & pass & {return} & tags to file prefFile
			close access file prefFile
		on error e
			close access file prefFile
		end try
		set usernamePasswordString to username & ":" & pass
		set tagsString to tags & " "
	end try
end checkUsernameAndPassword

Tyler Durden’s 8 Rules of Innovation

“It’s only after we’ve lost everything that we’re free to do anything.”

Oh, yeah… don’t be afraid to make big mistakes. More importantly, don’t worry about everything going according to plan. In fact, if everything’s going according to plan, there’s a good chance nothing remarkable is getting done.

They say life is what happens while you’re making other plans. Innovation is what happens when you recognize when to change the plan and perhaps the entire game. Maybe your initial plan falls apart, or maybe you simply need to throw the current plan away.

Don’t let the plan restrict the freedom to have a game-changing idea, and act on it, at any time. Losing everything may be the best thing that ever happens to you.

Tyler Durden’s 8 Rules of Innovation | Lateral Action

,

Before you go