BTT Preset back up with script does not work

Hi I was trying to run an AppleScript or terminal command to save a preset backup. None of the scripts seem to work. What am I doing wrong:

tell application "BetterTouchTool"
    export_preset "Default Main"
     outputPath "~/Desktop/DefaultMain.bttpreset"
end tell
osascript -e 'tell application "BetterTouchTool" to export_preset_to "~/Downloads/MyPreset.bttpreset"'
open -a "BetterTouchTool" --args export_preset ~/Downloads/MyPreset.bttpreset

Your first script should work. In the second you are missing the preset name and are using the incorrect function export_preset_to (_to doesn't exist) and the third way is not supported at all.

Here is a full example call:

tell application "BetterTouchTool" to export_preset "MyPreset" outputPath "/Users/xxx/Downloads/test.bttpreset" comment "NoComment" link "https://NoLink" with includeSettings

Thanks @Andreas_Hegenberg !

Your script works, but it saves a file equal to 9kb, and my two presents are 50 and 355 kb each, so it does not seem to save either of these. I don't want to import it as it threatens to overwrite my global preferences. I tried to rename "MyPreset" to "Default Main" and "btt-mobile-example" - names of my current presets and it didn't help. What am I doing wrong? I wish it would be a preset file in the BTT directory I can point to - in order to back it up.

you need to make sure the preset name matches exactly (including white space etc.), otherwise it will only export the settings

It did not work with the old name, but I changed the name to one word w/o spaces and it works now. Appreciate your help.

Ah that is interesting, I'll check whether there is an issue with spaces!

I recently realized that backing up the presets isn't enough. In the worst case scenario, I would lose too much. So I back up the BTT folder in App Support. Then you really have everything... hopefully :slightly_smiling_face:

What are you missing in the preset that requires you to backup the entire folder?

presets e.g. don’t contain your clipboard history or other temporary files created through action usage

In general just using standard backup mechanism like Apple’s Time machine will cover everything and every Mac user should have such a backup system :slight_smile:

Makes sense - appreciate it.