Backup Hazel Rules?

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Backup Hazel Rules? Tue Dec 30, 2014 11:07 am • by scottfwalter
All,

I have a process that I backup all my system files (i.e. Dropbox, TextExpander, Hazel, etc.) into a folder and then store that folder onto a USB drive. I would like to automate this process. The only way to export Hazel rules is to manually export the rules.

Does anyone know of a way to automate this so I don't have to manually export the rules. Perhaps Applescript or some other way.

Thanks Scott.
scottfwalter
 
Posts: 47
Joined: Thu Jan 03, 2013 11:10 am

Re: Backup Hazel Rules? Tue Dec 30, 2014 11:47 am • by scottfwalter
So far I have this Applescript that will automate System Preferences to do the keypresses but looking for a better solution.


Code: Select all
set ENTER_KEY to 36
set TAB_KEY to 48
set DOWN_KEY to 125

if application "System Preferences" is running then
   tell application "System Preferences" to quit
end if

tell application "System Preferences"
   delay 0.5
   activate
   
   set the current pane to pane id "com.noodlesoft.hazel"
   
   tell application "System Events"
      delay 0.5
      key code TAB_KEY
      key code TAB_KEY
      key code TAB_KEY
      key code TAB_KEY
      key code TAB_KEY
      key code DOWN_KEY
      key code DOWN_KEY
      key code DOWN_KEY
      key code DOWN_KEY
      key code ENTER_KEY
      
      delay 0.5
      key code 5 using {command down, shift down}
      delay 0.5
      keystroke "/Volumes/My System Files Backup/Hazel"
      key code ENTER_KEY
      delay 0.5
      key code ENTER_KEY
   end tell
end tell

scottfwalter
 
Posts: 47
Joined: Thu Jan 03, 2013 11:10 am

Re: Backup Hazel Rules? Tue Dec 30, 2014 2:22 pm • by Mr_Noodle
Hazel stores its rules and settings in the following places:

- In your Library/Application Support folder, the Hazel folder
- In your Library/Preferences folder, the files starting with com.noodlesoft.

Those are standard locations for this type of thing so it might be worth just backing up the whole Preferences and Application Support folders.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Backup Hazel Rules? Wed Dec 31, 2014 11:43 am • by scottfwalter
I guess I was looking at this the hard way. I thought I wanted a quick and easy way to automate the backup of my rules just like the export functionality works. However really I just want a copy ~/Library/Application\ Support/Hazel which I can easily backup.
scottfwalter
 
Posts: 47
Joined: Thu Jan 03, 2013 11:10 am


Return to Open Discussion