# Dynamic Macros keep getting erased

**URL:** https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799
**Category:** Uncategorized
**Created:** [October 20, 2022, 4:56pm UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799 "2022-10-20T16:56:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![MatthewHunt84](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/matthewhunt84/32/4425_2.png) [@MatthewHunt84](https://community.keyboard.io/u/MatthewHunt84)
#### Post date: [October 20, 2022, 4:56pm UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/1 "2022-10-20T16:56:53Z")

</div>

Just had this happen for the fourth time and decided it was time to reach out for help.  
I have around 20 dynamic macros that I am getting tired of having to reprogram in Chrysalis.

macOS 11.6.1 / Chrysalis 0.11.8 / 0.90.6-snapshot.58

Chrysalis is always open when it happens with some kind of error, this time it was:

 ![Screen Shot 2022-10-20 at 10.47.41 AM](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/e/e16c5be310bbbf18e34e346829dcc8c94d36dd82.png)

---

<div class="post-metadata">

### Author: ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)
#### Post date: [October 20, 2022, 5:39pm UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/2 "2022-10-20T17:39:56Z")

</div>

Next time this happens, can you please go to the “Report a Problem” menu item in Chrysalis, create a bundle, and upload it here? (or DM it to me)

The debug bundle contains a lot more information that can help us figure out why certain bugs manifest. Sadly, just from the screenshot above, I have no idea what could lead to this error. We only use `.trimEnd()` in one place, when _reading_ macros from the keyboard, and it shouldn’t happen if your dynamic macros are otherwise functional.

---

<div class="post-metadata">

### Author: ![MatthewHunt84](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/matthewhunt84/32/4425_2.png) [@MatthewHunt84](https://community.keyboard.io/u/MatthewHunt84)
#### Post date: [October 20, 2022, 5:59pm UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/3 "2022-10-20T17:59:29Z")

</div>

No worries, will do!

Follow up question, is there a way to backup macros? I’ve tried exporting my layouts and then importing them after an incident like this but the dynamic macros are always empty when the layout is reloaded.

---

<div class="post-metadata">

### Author: ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)
#### Post date: [October 20, 2022, 6:28pm UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/4 "2022-10-20T18:28:40Z")

</div>

> [@MatthewHunt84](#):
>
> Follow up question, is there a way to backup macros?

Not with Chrysalis, not yet. For the time being, I’d recommend using the `focus` tool from [kaleidoscope-focus.rs](https://github.com/keyboardio/kaleidoscope-focus.rs/releases/tag/latest). It can do full backups, which you can then restore, or you can individually backup & restore parts of your settings.

To use it, download the pre-built binary for macOS (amd64 or aarch64, depending on the type of hardware you have), unpack it somewhere, and then you can do the following from a terminal:

```bash
## To back things up:
./focus backup >backup.json
## To restore them:
./focus restore <backup.json
## To save macros only:
./focus send macros.map >macros.txt
## To restore macros only:
./focus send macros.map $(cat macros.txt)

```

Chrysalis should not be connected to the keyboard while you do this. The tool will also automatically detect your Model100, so you don’t need to tell it where to find it. If you have multiple Keyboardio keyboards connected, you can tell the tool which one to connect to with the `--device` option, and giving in a path, the same `/dev/....` path Chrysalis displays for the device, such as:

```bash
./focus send --device /dev/cu.usbmodemCkbio01E

```

---

<div class="post-metadata">

### Author: ![MatthewHunt84](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/matthewhunt84/32/4425_2.png) [@MatthewHunt84](https://community.keyboard.io/u/MatthewHunt84)
#### Post date: [October 24, 2022, 2:29pm UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/5 "2022-10-24T14:29:47Z")

</div>

Amazing, thank you for such a helpful and detailed reply @algernon !!

---

<div class="post-metadata">

### Author: ![Roy](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Roy](https://community.keyboard.io/u/Roy)
#### Post date: [October 25, 2023, 9:21am UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/6 "2023-10-25T09:21:35Z")

</div>

I also keep losing Dynamic Macros - but without the error message @MatthewHunt84 was getting. They just disappear…or to be more precise, _many_ of them disappear. It’s showing “Macro space used: 67/1024” when previously I had well over 100 bytes stored.

@algernon - Bundle attached as per your request above  
[23 10 25 chrysalis-debug.json.txt](https://community.keyboard.io/uploads/short-url/5UYfh4pHotlcMd2CV7AgbrUVrOz.txt) (270.5 KB)

(I’m on Chrysalis 0.12.0, which doesn’t upgrade but generates this error when it tries to:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/3/32045990a9ed43fc67ff4dee44b7fbcb26553c78.png)  
)

---

<div class="post-metadata">

### Author: ![Roy](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Roy](https://community.keyboard.io/u/Roy)
#### Post date: [October 25, 2023, 9:46am UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/8 "2023-10-25T09:46:52Z")

</div>

> [@algernon](#):
>
> To use it, download the pre-built binary for macOS (amd64 or aarch64, depending on the type of hardware you have), unpack it somewhere, and then you can do the following from a terminal:
> 
> ```auto
> ## To save macros only:
> ./focus send macros.map >macros.txt
> ## To restore macros only:
> ./focus send macros.map $(cat macros.txt)
> 
> ```
> 
> Chrysalis should not be connected to the keyboard while you do this

I’ve tried this… backed up and restored, and it appears to have erased the remaining dynamic macros! (The “Macro space used” number behaved strangely… on the first restore it went to 1/1024, when I was expecting it to go back to 67. I tried restoring again with a different filename (no space) and it went to 101, when again I was expecting it to go to 67.)  
(I’m on windows 10)

---

<div class="post-metadata">

### Author: ![Roy](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Roy](https://community.keyboard.io/u/Roy)
#### Post date: [October 27, 2023, 10:01am UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/9 "2023-10-27T10:01:14Z")

</div>

I’ve now uninstalled and reinstalled Chrysalis, and started using regular macros (by installing the default Kaleidoscope and adding macros to it).

I now find in Chrysalis that Dynamic Macros 0-9 have disappeared from the menu!  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/2X/7/7a591264d29b9c589ec6e05f3d3f6ecf969f9ad1.png)

---

<div class="post-metadata">

### Author: ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)
#### Post date: [November 2, 2023, 7:22pm UTC](https://community.keyboard.io/t/dynamic-macros-keep-getting-erased/5799/10 "2023-11-02T19:22:05Z")

</div>

IIRC, this was a change to how dynamic macros got handled in Chrysalis, but it’s been quite a while
