Remove unnecessary 0s on a Hazel rename action

Hey guys,

I’m using Hazel to fetch some data with content match tokens, and some of them are looking for numbers which are formatted like this: 0000123

I’ve successfully managed to use these tokens on renaming actions, but was wondering if there’s a way to remove all those extra zeroes before the name itself. Thought of using “text replace” feature for ripping of zeroes, but that would result in a problem when examining numbers such as 0001010.

In lieu of running a regex via AppleScript to generate the file name, how about running a rename shell script at the end?

1 Like