I recently extened a script that I trigger with a keyboard shortcut but today I find that it somehow went back to the earlier version (i.e. without the new code). Since I am syncing my settings via Dropbox, I suspected a sync issue and wanted to see if I can recover earlier versions of the file.
The problem is: I can't seem to figure out where that script is saved. I looked through all the folders in the Dropbox folder but found most of them to be unmodified for at least a year. And among the ones with a more recent Last Modified date, I couldn't identify one with a script.
Where am I going wrong? Did I not look close enough? Or am I looking in the wrong place?
In case it matters: the script is an AppleScript in an action that is part of a Named Trigger.
all of BTT's database is stored in ~/Library/Application Support/BetterTouchTool, however you won't be able to extract single elements like scripts. It's all stored in a database. You also won't be able to recover them from Dropbox because BTT only stores the diffs / update objects in Dropbox (in ~/Library/Application Support/com.hegenberg.BetterTouchTool/com.mentalfaculty.ensembles.eventdata/MainStore.v2)
The Dropbox sync is indeed very experimental and it will be replaced later this year with a much better solution. I would not recommend to use it at the moment.
BTT however does create auto backups from time to time. Maybe you can restore one via Help => Restore Settings from Backup (disable sync before doing so)
I'm finding that my scripts (mostly javascript) are getting complicated enough that I often want to either look at the changes since a previous version, or roll back just that script to a previous version.
These are things that a version control system does well. Is there any way to store the scripts for Javascript and Apple script actions/triggers/widgets in a version control system rather than in whatever BTT usually uses, and/or to import an entire set of scripts to triggers from known locations?
(I guess that I could try and use BTT do to that last thing, which is appealing because it is self-referential, but it seems like it would be fragile and likely to break on changes to the BTT UI...)
If this is not currently possible, would you be open to adding a way to do this, maybe just as a text box for script actions that specifies a location in the file system where the script is read from at BTT start? (and maybe re-read and written to when that script is opened and saved in the BTT UI).
This could provide some added advantages in that it would allow scripts to be opened in other editors (e.g. VS Code) and might make it easier for a set of scripts implementing a preset to be be shared for collaboration as a GitHub or other repo.
I just started using the new option to store scripts externally. It's great, I have my scripts in git and can edit in an IDE, and BTT does a good job of noticing changes and updating when necessary.