Table of Contents

HammerSpoon

HammerSpoon is a handy automation app for Mac

Once you have downloaded you should then see the hammer icon in your taskbar


Example commands

Type out contents of ClipBoard

Simulates typing of text saved in your clipboard. This is particularly useful when using Teamviewer where Windows login screens will not let you use standard paste functionality for entering passwords

This code use ALT + SHIFT + V to execute the automation (but you can change the key combination used):

hs.hotkey.bind({"alt", "shift"}, "V", function() hs.eventtap.keyStrokes(hs.pasteboard.getContents()) end)

Open specific url in Chrome tab

Open a Chrome tab to a specific webpage using a key command (ALT + SHIFT + J) - in this case the TMF Jobsheets Web-app

hs.hotkey.bind({"alt", "shift"}, "J", function() hs.urlevent.openURLWithBundle('https://accounts.msupply.org:6710/#/daily-jobsheets-add', 'com.google.Chrome') end)

Trouble shooting

Launch Hammerspoon at login preference does not stay enabled

1) Go to System Settings > General > Login Items > Select Hammerspoon.app from Open at login list > Click minus button (-)
2) Inside Hammerspoon.app click Launch at login again and it should persist.