# Find and replace function

**URL:** <https://community.folivora.ai/t/find-and-replace-function/38120>\
**Category:** Configuration Help & General Discussion\
**Created:** [July 5, 2024, 7:55pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120 "2024-07-05T19:55:02Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [July 5, 2024, 7:55pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/1 "2024-07-05T19:55:02Z")

</div>

Trying to create a find and replace all function

 ![image](https://community.folivora.ai/uploads/default/original/3X/9/1/919e994de65ebf27d22d19d551c67dc9cc764931.png)

IDK if there's a better, easier, more direct way of doing this.

Tried using KM, it works well and it's fast, it just doesn't process selected text, I need to copy it..

 ![image](https://community.folivora.ai/uploads/default/original/3X/c/8/c8925455421e533ebda26e2bef41f36192f03f21.png)

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 6, 2024, 1:07pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/2 "2024-11-06T13:07:37Z")

</div>

Hey @Andreas_Hegenberg

Still need help with this 🙂

**This is what I have so far:**  
 ![Arc 2024-11-06 2.04.14 PM](https://community.folivora.ai/uploads/default/original/3X/b/1/b15c26b1ef2c67d36059669e38c837e260376ed1.png)

![Arc 2024-11-06 2.04.17 PM](https://community.folivora.ai/uploads/default/original/3X/c/d/cd3b5f18f485cd22a7cdef652055446b4b2370ba.png)

Used ChatGPT to generate the script, IDK if it's correct

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [November 6, 2024, 3:00pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/3 "2024-11-06T15:00:05Z")

</div>

what happens when you try this? The code does look fine

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 6, 2024, 8:18pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/4 "2024-11-06T20:18:29Z")

</div>

Tried in google Docs, it doesn't do anything... IDK What's wrong..

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [November 6, 2024, 8:22pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/5 "2024-11-06T20:22:34Z")

</div>

could you copy & paste the whole trigger? Then I can try here

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 6, 2024, 8:43pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/6 "2024-11-06T20:43:34Z")

</div>

Sure thing

```auto
[
  {
    "BTTActionCategory" : 0,
    "BTTLastUpdatedAt" : 1730897656.013896,
    "BTTTriggerType" : 773,
    "BTTTriggerTypeDescription" : "Standard Item",
    "BTTTriggerParentUUID" : "C5007534-F241-42A2-912B-96E73AA5C0C2",
    "BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
    "BTTUUID" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
    "BTTPredefinedActionType" : 403,
    "BTTPredefinedActionName" : "Ask For Input (Save To Variable)",
    "BTTAdditionalActionData" : {
      "BTTActionAskForInputVariableName" : "replacetext_find",
      "BTTActionAskForInputPrompt" : "FIND:"
    },
    "BTTAdditionalConfiguration" : "Menu Item: _lowercaps",
    "BTTEnabled" : 1,
    "BTTOrder" : 11,
    "BTTDisplayOrder" : 1,
    "BTTMenuItemActions" : [
      {
        "BTTActionCategory" : 0,
        "BTTLastUpdatedAt" : 1730898522.105094,
        "BTTTriggerType" : 773,
        "BTTTriggerTypeDescription" : "Standard Item",
        "BTTTriggerParentUUID" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
        "BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
        "BTTUUID" : "94F6068C-CD71-4E7E-BE37-206DD2940288",
        "BTTPredefinedActionType" : 284,
        "BTTPredefinedActionName" : "Transform & Replace Selection With Java Script",
        "BTTAdditionalActionData" : {
          "SelectedTransformerTab" : 1,
          "BTTClipboardTransformerJS" : "async (clipboardContentString) => {\n const findText = await BetterTouchTool.get_string_variable(\"replacetext_find\");\n const replaceText = await BetterTouchTool.get_string_variable(\"replacetext_replace\");\n\n if (findText) {\n return clipboardContentString.replace(new RegExp(findText, 'g'), replaceText || \"\");\n }\n return clipboardContentString;\n}"
        },
        "BTTGenericActionConfig" : "find and replace all",
        "BTTAdditionalConfiguration" : "Menu Item: FIND & Replace",
        "BTTEnabled" : 1,
        "BTTOrder" : 1,
        "BTTDisplayOrder" : 1,
        "BTTTriggerName" : "Menu Item: FIND & Replace",
        "BTTMenuConfig" : {
          "BTTMenuItemImageHeight" : 40,
          "BTTMenuItemIconColor1" : "255.000000, 255.000000, 255.000000, 255.000000",
          "BTTMenuItemImageOffsetX" : 0,
          "BTTMenuItemDisplayOrder" : 1,
          "BTTMenuItemBackgroundColor" : "0.000000, 0.000000, 0.000000, 155.322861",
          "BTTMenuItemBackgroundType" : 4,
          "BTTMenuItemBlurredBackground" : 0,
          "BTTMenuSelectedTab" : 0,
          "BTTMenuItemMaxHeight" : 170,
          "BTTMenuItemPaddingLeft" : 5,
          "BTTMenuItemMaxWidth" : 170,
          "BTTMenuCategoryItemIcon" : 1,
          "BTTMenuItemPaddingTop" : 5,
          "BTTMenuCategoryShadow" : 0,
          "BTTMenuItemIconColor2" : "255.000000, 255.000000, 255.000000, 255.000000",
          "BTTMenuCategoryItemSpacing" : 0,
          "BTTMenuItemIconTypeDark" : 2,
          "BTTMenuCategoryModifiers" : 0,
          "BTTLastChangeUUID" : "37CB7CE9-E15D-46C5-BF50-833313BD9BB8",
          "BTTMenuItemSFSymbolName" : "magnifyingglass",
          "BTTMenuItemImageOffsetY" : 0,
          "BTTMenuItemIconPosition" : 1,
          "BTTMenuItemSFSymbolWeight" : 8,
          "BTTMenuItemMinHeight" : 170,
          "BTTMenuItemSFSymbolStyle" : 0,
          "BTTMenuItemVisibleWhileActive" : 1,
          "BTTMenuElementIdentifier" : "FIND & Replace",
          "BTTMenuItemVisibleWhileInactive" : 1,
          "BTTMenuItemMinWidth" : 170,
          "BTTMenuItemPaddingRight" : 5,
          "BTTMenuAttributedText" : "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2820\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fnil\\fcharset0 SFPro-Regular;}\n{\\colortbl;\\red255\\green255\\blue255;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;\\cssrgb\\c100000\\c100000\\c100000;}\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\pardirnatural\\qc\\partightenfactor0\n\n\\f0\\fs50 \\cf2 FIND & Replace}",
          "BTTMenuItemIconType" : 2,
          "BTTMenuItemIconColor3" : "255.000000, 255.000000, 255.000000, 255.000000",
          "BTTMenuAppearanceStyle" : 1,
          "BTTMenuItemPaddingBottom" : 5,
          "BTTMenuAlwaysUseLightMode" : 1,
          "BTTMenuCategoryBackground" : 1,
          "BTTMenuCategoryItemSizing" : 1
        },
        "BTTMenuAvailability" : 0,
        "BTTMenuName" : "FIND & Replace",
        "BTTGestureNotes" : "Standard Item"
      },
      {
        "BTTActionCategory" : 0,
        "BTTLastUpdatedAt" : 1730897633.6531181,
        "BTTTriggerParentUUID" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
        "BTTIsPureAction" : true,
        "BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
        "BTTUUID" : "096D48D7-3659-4F43-B0F3-8D0DB600BF32",
        "BTTPredefinedActionType" : 403,
        "BTTPredefinedActionName" : "Ask For Input (Save To Variable)",
        "BTTAdditionalActionData" : {
          "BTTActionAskForInputVariableName" : "replacetext_replace",
          "BTTActionAskForInputPrompt" : "Replace with:"
        },
        "BTTAdditionalConfiguration" : "Menu Item: _lowercaps",
        "BTTEnabled" : 1,
        "BTTOrder" : 0,
        "BTTMenuAvailability" : 0,
        "BTTMenuName" : "096D48D7-3659-4F43-B0F3-8D0DB600BF32"
      }
    ],
    "BTTMenuConfig" : {
      "BTTMenuItemImageHeight" : 40,
      "BTTMenuItemIconColor1" : "255.000000, 255.000000, 255.000000, 255.000000",
      "BTTMenuItemImageOffsetX" : 0,
      "BTTMenuItemDisplayOrder" : 1,
      "BTTMenuItemBackgroundColor" : "0.000000, 0.000000, 0.000000, 155.322861",
      "BTTMenuItemBackgroundType" : 4,
      "BTTMenuItemBlurredBackground" : 0,
      "BTTMenuSelectedTab" : 0,
      "BTTMenuItemMaxHeight" : 170,
      "BTTMenuItemPaddingLeft" : 5,
      "BTTMenuItemMaxWidth" : 170,
      "BTTMenuCategoryItemIcon" : 1,
      "BTTMenuItemPaddingTop" : 5,
      "BTTMenuCategoryShadow" : 0,
      "BTTMenuItemIconColor2" : "255.000000, 255.000000, 255.000000, 255.000000",
      "BTTMenuCategoryItemSpacing" : 0,
      "BTTMenuItemIconTypeDark" : 2,
      "BTTMenuCategoryModifiers" : 0,
      "BTTLastChangeUUID" : "37CB7CE9-E15D-46C5-BF50-833313BD9BB8",
      "BTTMenuItemSFSymbolName" : "magnifyingglass",
      "BTTMenuItemImageOffsetY" : 0,
      "BTTMenuItemIconPosition" : 1,
      "BTTMenuItemSFSymbolWeight" : 8,
      "BTTMenuItemMinHeight" : 170,
      "BTTMenuItemSFSymbolStyle" : 0,
      "BTTMenuItemVisibleWhileActive" : 1,
      "BTTMenuElementIdentifier" : "FIND & Replace",
      "BTTMenuItemVisibleWhileInactive" : 1,
      "BTTMenuItemMinWidth" : 170,
      "BTTMenuItemPaddingRight" : 5,
      "BTTMenuAttributedText" : "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2820\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fnil\\fcharset0 SFPro-Regular;}\n{\\colortbl;\\red255\\green255\\blue255;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;\\cssrgb\\c100000\\c100000\\c100000;}\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\pardirnatural\\qc\\partightenfactor0\n\n\\f0\\fs50 \\cf2 FIND & Replace}",
      "BTTMenuItemIconType" : 2,
      "BTTMenuItemIconColor3" : "255.000000, 255.000000, 255.000000, 255.000000",
      "BTTMenuAppearanceStyle" : 1,
      "BTTMenuItemPaddingBottom" : 5,
      "BTTMenuAlwaysUseLightMode" : 1,
      "BTTMenuCategoryBackground" : 1,
      "BTTMenuCategoryItemSizing" : 1
    },
    "BTTMenuAvailability" : 0,
    "BTTMenuName" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
    "BTTGestureNotes" : "Standard Item"
  }
]

```

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [November 6, 2024, 9:08pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/7 "2024-11-06T21:08:52Z")

</div>

try this instead:

```auto
async (clipboardContentString) => {
    const findText = await get_string_variable("replacetext_find");
    const replaceText = await get_string_variable("replacetext_replace");

    if (findText) {
        const regex = new RegExp(findText, 'g');
        return clipboardContentString.replace(regex, replaceText || "");
    }
    return clipboardContentString;
}

```

```JS
[
  {
    "BTTActionCategory" : 0,
    "BTTLastUpdatedAt" : 1730927244.6270862,
    "BTTTriggerType" : 773,
    "BTTTriggerTypeDescription" : "Standard Item",
    "BTTTriggerParentUUID" : "FBC77E7A-90EF-4D00-9BB0-354553194C7C",
    "BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
    "BTTUUID" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
    "BTTPredefinedActionType" : 403,
    "BTTPredefinedActionName" : "Ask For Input (Save To Variable)",
    "BTTAdditionalActionData" : {
      "BTTActionAskForInputVariableName" : "replacetext_find",
      "BTTActionAskForInputPrompt" : "FIND:"
    },
    "BTTAdditionalConfiguration" : "Menu Item: _lowercaps",
    "BTTEnabled" : 1,
    "BTTOrder" : 9,
    "BTTDisplayOrder" : 1,
    "BTTTriggerName" : "Menu Item: E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
    "BTTMenuItemActions" : [
      {
        "BTTActionCategory" : 0,
        "BTTLastUpdatedAt" : 1730927296.984045,
        "BTTTriggerParentUUID" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
        "BTTIsPureAction" : true,
        "BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
        "BTTUUID" : "E394C5E3-0C54-4933-890A-64596E4B0DE8",
        "BTTPredefinedActionType" : 345,
        "BTTPredefinedActionName" : "Pause Execution or Delay Next Action (async or not blocking)",
        "BTTDelayNextActionBy" : "0.1",
        "BTTEnabled" : 1,
        "BTTOrder" : 1,
        "BTTMenuAvailability" : 0,
        "BTTMenuName" : "E394C5E3-0C54-4933-890A-64596E4B0DE8"
      },
      {
        "BTTActionCategory" : 0,
        "BTTLastUpdatedAt" : 1730927251.4466329,
        "BTTTriggerParentUUID" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
        "BTTIsPureAction" : true,
        "BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
        "BTTUUID" : "7ABA0BBD-9FE3-459F-9BC1-1C5451A56D17",
        "BTTPredefinedActionType" : 284,
        "BTTPredefinedActionName" : "Transform & Replace Selection With Java Script",
        "BTTAdditionalActionData" : {
          "BTTClipboardTransformerExampleInput" : "thello quak",
          "BTTClipboardTransformerJS" : "async (clipboardContentString) => {\n const findText = await get_string_variable(\"replacetext_find\");\n const replaceText = await get_string_variable(\"replacetext_replace\");\n\n if (findText) {\n const regex = new RegExp(findText, 'g');\n return clipboardContentString.replace(regex, replaceText || \"\");\n }\n return clipboardContentString;\n}\n"
        },
        "BTTEnabled" : 1,
        "BTTOrder" : 2,
        "BTTMenuAvailability" : 0,
        "BTTMenuName" : "7ABA0BBD-9FE3-459F-9BC1-1C5451A56D17"
      },
      {
        "BTTActionCategory" : 0,
        "BTTLastUpdatedAt" : 1730927251.4466381,
        "BTTTriggerParentUUID" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
        "BTTIsPureAction" : true,
        "BTTTriggerClass" : "BTTTriggerTypeFloatingMenu",
        "BTTUUID" : "096D48D7-3659-4F43-B0F3-8D0DB600BF32",
        "BTTPredefinedActionType" : 403,
        "BTTPredefinedActionName" : "Ask For Input (Save To Variable)",
        "BTTAdditionalActionData" : {
          "BTTActionAskForInputVariableName" : "replacetext_replace",
          "BTTActionAskForInputPrompt" : "Replace with:"
        },
        "BTTAdditionalConfiguration" : "Menu Item: _lowercaps",
        "BTTEnabled" : 1,
        "BTTOrder" : 0,
        "BTTMenuAvailability" : 0,
        "BTTMenuName" : "096D48D7-3659-4F43-B0F3-8D0DB600BF32"
      }
    ],
    "BTTMenuConfig" : {
      "BTTMenuItemImageHeight" : 40,
      "BTTMenuItemIconColor1" : "255.000000, 255.000000, 255.000000, 255.000000",
      "BTTMenuItemImageOffsetX" : 0,
      "BTTMenuItemDisplayOrder" : 1,
      "BTTMenuItemBackgroundColor" : "0.000000, 0.000000, 0.000000, 155.322861",
      "BTTMenuItemBackgroundType" : 4,
      "BTTMenuItemBlurredBackground" : 0,
      "BTTMenuSelectedTab" : 0,
      "BTTMenuItemMaxHeight" : 170,
      "BTTMenuItemPaddingLeft" : 5,
      "BTTMenuItemMaxWidth" : 170,
      "BTTMenuCategoryItemIcon" : 1,
      "BTTMenuItemPaddingTop" : 5,
      "BTTMenuCategoryShadow" : 0,
      "BTTMenuItemIconColor2" : "255.000000, 255.000000, 255.000000, 255.000000",
      "BTTMenuCategoryItemSpacing" : 0,
      "BTTMenuItemIconTypeDark" : 2,
      "BTTMenuCategoryModifiers" : 0,
      "BTTLastChangeUUID" : "37CB7CE9-E15D-46C5-BF50-833313BD9BB8",
      "BTTMenuItemSFSymbolName" : "magnifyingglass",
      "BTTMenuItemImageOffsetY" : 0,
      "BTTMenuItemIconPosition" : 1,
      "BTTMenuItemSFSymbolWeight" : 8,
      "BTTMenuItemMinHeight" : 170,
      "BTTMenuItemSFSymbolStyle" : 0,
      "BTTMenuItemVisibleWhileActive" : 1,
      "BTTMenuElementIdentifier" : "FIND & Replace",
      "BTTMenuItemVisibleWhileInactive" : 1,
      "BTTMenuItemMinWidth" : 170,
      "BTTMenuItemPaddingRight" : 5,
      "BTTMenuAttributedText" : "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2820\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fnil\\fcharset0 SFPro-Regular;}\n{\\colortbl;\\red255\\green255\\blue255;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;\\cssrgb\\c100000\\c100000\\c100000;}\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\pardirnatural\\qc\\partightenfactor0\n\n\\f0\\fs50 \\cf2 FIND & Replace}",
      "BTTMenuItemIconType" : 2,
      "BTTMenuItemIconColor3" : "255.000000, 255.000000, 255.000000, 255.000000",
      "BTTMenuAppearanceStyle" : 1,
      "BTTMenuItemPaddingBottom" : 5,
      "BTTMenuAlwaysUseLightMode" : 1,
      "BTTMenuCategoryBackground" : 1,
      "BTTMenuCategoryItemSizing" : 1
    },
    "BTTMenuAvailability" : 0,
    "BTTMenuName" : "E6FB96CB-D0F9-43F6-87B0-7A7083E9A6E7",
    "BTTGestureNotes" : "Standard Item"
  }
]

```

 ![image](https://community.folivora.ai/uploads/default/original/3X/3/8/382eb7e35cbc5c8fe6bf14fe2c17278b36107512.jpeg)

The short delay is important because apparently it takes a few milliseconds until the input field is hidden - if it is still visible when the transform action is called, it will try transform the contents of the textfield.

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 6, 2024, 9:33pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/8 "2024-11-06T21:33:41Z")

</div>

It works perfectly now!  
Many Thanks for the support!

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 11, 2024, 5:33pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/9 "2024-11-11T17:33:22Z")

</div>

Another quick question @Andreas_Hegenberg

I have an issue with this

![Arc 2024-11-11 6.29.02 PM](https://community.folivora.ai/uploads/default/original/3X/7/2/72c575538c3f890481ffe41df584240d8a748967.png)

I can't use my clipboard manager [paste](https://pasteapp.io/) while the input fields is up or even go copy and paste something in that field, as Soon click away, the input fields submits automatically and disappears...

![image](https://community.folivora.ai/uploads/default/original/3X/b/6/b63ea0a9eb3290fd9614a6c3f8a25de0b259d673.png)  
I don't see any setting here to "Keep floating on top"

Please let me know if there's a feature like that coming soon, or if there's a workaround in the meanwhile..

Thanks!

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 25, 2024, 1:49pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/10 "2024-11-25T13:49:59Z")

</div>

Hey @Andreas_Hegenberg  
Any input here would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [November 27, 2024, 8:12pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/11 "2024-11-27T20:12:54Z")

</div>

I'll add an option to only close when hitting enter with the next version!

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 27, 2024, 8:44pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/12 "2024-11-27T20:44:25Z")

</div>

Amazing!  
I'm using paste as a clipboard manager, hopefully I'm gonna be able to paste text from it into that field.

Many Thanks!!!

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [November 28, 2024, 10:13am UTC](https://community.folivora.ai/t/find-and-replace-function/38120/13 "2024-11-28T10:13:08Z")

</div>

The option is now available in the 4.904 alpha:

 ![image](https://community.folivora.ai/uploads/default/original/3X/f/c/fc4612fd63cd6b1de365387eb1ed9026941b1613.jpeg)

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 28, 2024, 10:34am UTC](https://community.folivora.ai/t/find-and-replace-function/38120/14 "2024-11-28T10:34:29Z")

</div>

That's awesome, the only problem I have with it is, it doesn't accept text from my clipboard manager directly, it just replaces the selected text I wanna process.

Also, when I copy something to my clipboard while having the text selected, it doesn't work, the replacement doesn't work, I have to leave that text unselected until and copied and pasted everything for it to work..., I suppose the clipboard is the temp storage for those variables?

This is still my setup:

 ![BetterTouchTool 2024-11-28 11.33.56 AM](https://community.folivora.ai/uploads/default/original/3X/b/6/b6a90195d5241fbf0fc403a8619e30463105dc3b.jpeg)  
 ![BetterTouchTool 2024-11-28 11.34.04 AM](https://community.folivora.ai/uploads/default/original/3X/1/5/15b9279b55bc72e1fbcb5f020d5de065e915c280.jpeg)

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [November 28, 2024, 11:08am UTC](https://community.folivora.ai/t/find-and-replace-function/38120/15 "2024-11-28T11:08:22Z")

</div>

I think I might not fully understand your usecase. Could you maybe post the steps I should try? (or create a quick screen capture)

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 28, 2024, 11:50am UTC](https://community.folivora.ai/t/find-and-replace-function/38120/16 "2024-11-28T11:50:13Z")

</div>

This is a loom detailing my use case:

https://www.loom.com/embed/9bcc2b4ca430472d8db1fee68d20fe21?sid=93db9ec9-1071-4ccd-96ae-45031313c405

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [November 28, 2024, 12:26pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/17 "2024-11-28T12:26:08Z")

</div>

Ah I see, most likely the clipboard manager doesn't "see" that BetterTouchTool input window because it doesn't capture full focus. However the clipboard manager seems to capture focus, which leads to a confusing state.

In v4.906 I added an option to capture focus, maybe this will help in your scenario:

 ![image](https://community.folivora.ai/uploads/default/original/3X/9/a/9a4788c8a810cd0c9784fc52163ba8dd08446c0a.jpeg)

---

<div class="post-metadata">

**Author:** ![Brahim](https://community.folivora.ai/user_avatar/community.folivora.ai/brahim/32/25752_2.png) [@Brahim](https://community.folivora.ai/u/Brahim)\
**Post date:** [November 28, 2024, 12:52pm UTC](https://community.folivora.ai/t/find-and-replace-function/38120/18 "2024-11-28T12:52:09Z")

</div>

That works perfectly!  
Thank you so much! 🙏
