Chris Hocking

Results 227 comments of Chris Hocking

@Hatlen - You're better off using the bundle ID.

As in, you basically want a `getMenu`, in addition to `setMenu`? I feel like this might be an older module, where newer modules wouldn't have specific "get" and "set" methods,...

Try something like this: ```lua scrollWheelSwap = hs.eventtap.new({hs.eventtap.event.types.scrollWheel}, function(e) swappedDeltaAxis1 = e:getProperty(hs.eventtap.event.properties.scrollWheelEventDeltaAxis2) swappedDeltaAxis2 = e:getProperty(hs.eventtap.event.properties.scrollWheelEventDeltaAxis1) swappedFixedPtDeltaAxis1 = e:getProperty(hs.eventtap.event.properties.scrollWheelEventFixedPtDeltaAxis2) swappedFixedPtDeltaAxis2 = e:getProperty(hs.eventtap.event.properties.scrollWheelEventFixedPtDeltaAxis1) swappedPointDeltaAxis1 = e:getProperty(hs.eventtap.event.properties.scrollWheelEventPointDeltaAxis2) swappedPointDeltaAxis2 = e:getProperty(hs.eventtap.event.properties.scrollWheelEventPointDeltaAxis1) e:setProperty(hs.eventtap.event.properties.scrollWheelEventDeltaAxis1, swappedDeltaAxis1) e:setProperty(hs.eventtap.event.properties.scrollWheelEventDeltaAxis2,...

Great post @dge9! Whilst I agree with everything you've said, and I'd love to see Hammerspoon be as secure as possible, as @asmagill notes, I'm not exactly sure how you'd...

> The only preference key that (currently) affects Lua code execution is MJConfigFile No, as explained above, you can turn on AppleScript support via the property list property `HSAppleScriptEnabledKey`. Once...

This is an interesting thread of someone trying to protect something similar (just with `html` files instead of `lua`): https://stackoverflow.com/questions/35042903/how-do-i-get-an-osx-folder-checksum-in-objective-c

FWIW, running `find CONTENTS -type f -exec shasum {} \; | sort -k 2 | shasum` on the CommandPost code (which is probably the most complex Hammerspoon configuration out there)...

Thinking about it further, and reading about other Mac and iOS developers trying to protect assets in their "Resources" folder, I'm not sure there is a good way to really...

It actually works quite fast for me too! ```lua > local secondsSinceEpoch = require("hs.timer").secondsSinceEpoch local startTime = secondsSinceEpoch() local hash = hs.fs.directorySHA512("/path/to/commandpost/source") local endTime = secondsSinceEpoch() local result = endTime...