phato.blog

Humble semi-technical blog of Pat Wangrungarun

Handmade Timestamp Service in OSX

28 April 2013 in OSX · view history

When I need to test a form while developing, I was really bored and too lazy to think of some text to fill in any text input. Things like dasdsa or sajklhdas are too messy, and even though I have LittleIpsum installed it still takes too many clicks and mouse dragging. There must be a better way. I thought about using a timestamp.

So I found this post. Easy handmade service could do the job. Here’s how to set it up.

  • Launch Automator.app, add new Service.
  • Search for Run Shell Script and fill in date "+%Y-%m-%d %T", I’m using /bin/zsh by the way.
  • At the upper Service receives section, select no input and any application, also check Output replaces selected text.
  • Save the service, I named it Insert Timestamp.

img

  • Now go to System Preferences and Keyboard, in the Keyboard Shortcuts tab you will find your newly created service within the Text dropdown. Check to activate it and assign a keyboard shortcut. I use cmd + ctrl + shift + D for my setup.

img

And that’s it! Let’s enjoy this little handy trick ;)