# Add\_New\_Trigger and Icons Question (path vs base64 encoded)

**URL:** <https://community.folivora.ai/t/add-new-trigger-and-icons-question-path-vs-base64-encoded/30399>\
**Category:** Configuration Help & General Discussion\
**Tags:** applescript, menu-bar-icon\
**Created:** [February 17, 2023, 5:04am UTC](https://community.folivora.ai/t/add-new-trigger-and-icons-question-path-vs-base64-encoded/30399 "2023-02-17T05:04:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timbot](https://community.folivora.ai/user_avatar/community.folivora.ai/timbot/32/24281_2.png) [@timbot](https://community.folivora.ai/u/timbot)\
**Post date:** [February 17, 2023, 5:04am UTC](https://community.folivora.ai/t/add-new-trigger-and-icons-question-path-vs-base64-encoded/30399/1 "2023-02-17T05:04:25Z")

</div>

Hi, I finally got the base64 encoded icon working with automating making new triggers. I noticed there's an icon\_path in the supporting docs

> For the icon you can either provide it directly using the icon\_data parameter (must be base64 encoded) or you can provide a file path (via the icon\_path parameter) that points to the new icon.

Ive tried almost everything... is this possible in something like this...

```auto
set asstring to "{
    \"BTTTriggerType\" : 703,
    \"BTTTriggerTypeDescription\" : \"AS-" & "Happy2" & "\",
    \"BTTTriggerClass\" : \"BTTTriggerTypeNotchBar\",
    \"BTTPredefinedActionType\" : -1,
    \"BTTPredefinedActionName\" : \"No Action\",
    \"BTTEnabled2\" : 1,
    \"BTTRepeatDelay\" : 0,
    \"BTTNotesInsteadOfDescription\" : 0,
    \"BTTEnabled\" : 1,
    \"BTTModifierMode\" : 0,
    \"BTTOrder\" : 12,
    \"BTTDisplayOrder\" : 0,
    \"BTTMergeIntoTouchBarGroups\" : 0,
  here ------------> \"BTTIconPath\" : \"/Users/timjones/Desktop\",
    \"BTTTriggerConfig\" : {
      \"BTTTouchBarAppleScriptString\" : \"tell application \\\"System Events\\\" to activate\\ndisplay notification \\\"goodbye\\\"\\ndelay 4\\ndisplay notification \\\"hello\\\"\",
      \"BTTTouchBarButtonCornerRadius\" : 5,
      \"BTTTouchBarFreeSpaceAfterButton\" : 5,
      \"BTTTouchBarButtonColor\" : \"104.244579, 59.329082, 6.762083, 255.000000\",
      \"BTTTouchBarApplyCornerRadiusTo\" : 0,
      \"BTTTouchBarItemPlacement\" : 0,
      \"BTTTouchBarIconInvert\" : false,
      \"BTTTouchBarAlwaysShowButton\" : false,
      \"BTTTouchBarAppleScriptStringRunOnInit\" : false,
      \"BTTTouchBarButtonHoverColor\" : \"248.880000, 146.115000, 128.010000, 181.050000\",
      \"BTTNotchBarVisibilityStandardScreen\" : -1,
      \"BTTScriptType\" : 0,
      \"BTTTouchBarButtonHeight\" : 15,
      \"BTTTouchBarButtonWidth\" : 100,
      \"BTTTouchBarScriptUpdateInterval\" : 0,
      \"BTTTouchBarItemIconHeight\" : 15,
      \"BTTTouchBarButtonTextAlignment\" : 0,
      \"BTTTouchBarAlternateBackgroundColor\" : \"75.323769, 75.323769, 75.323769, 255.000000\",
      \"BTTTouchBarAppleScriptUsePath\" : 0,
      \"BTTTBWidgetWidth\" : 400,
      \"BTTTouchBarBorderColor\" : \"145.466926, 145.470452, 145.468552, 255.000000\",
	\"BTTTouchBarFreeSpaceBeforeButton\" : 0,
      \"BTTTouchBarItemIconWidth\" : 15,
      \"BTTTouchBarButtonName\" : \"&AS-" & "Happy2" & "\",
      \"BTTTouchBarButtonFontSize\" : 12,
      \"BTTTouchBarIconTextOffset\" : 5,
      \"BTTTouchBarOnlyShowIcon\" : false,
      \"BTTNotchBarVisibilityNotchScreen\" : 2,
      \"BTTTouchBarItemPadding\" : 0
    }
  }"
log asstring

tell application "BetterTouchTool" to add_new_trigger asstring

```

and where "here-------\>" is, I got the base64 working with this: just more characters...  
"BTTIconData" :"iVBORwB\<.....\>LyWF9d/Twk8llef5Aq4/18xyO3oLpAIK5ZW6uIwjEmx3nZ0hpoDey3Bv4/IyopysR7Gm0AAAAASUVORK5CYII=",

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![timbot](https://community.folivora.ai/user_avatar/community.folivora.ai/timbot/32/24281_2.png) [@timbot](https://community.folivora.ai/u/timbot)\
**Post date:** [February 22, 2023, 9:06pm UTC](https://community.folivora.ai/t/add-new-trigger-and-icons-question-path-vs-base64-encoded/30399/2 "2023-02-22T21:06:19Z")

</div>

Hello, sorry to bump... but any chance anyone has an answer to this? It's the last component of my code (and I would very much like to avoid dealing with multiple files- I automated an icon creator that creates various sizes/colors/etc.. based on which screen and resolution). It will be much less overwhelming for a noob coder like myself.

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:** [February 22, 2023, 9:27pm UTC](https://community.folivora.ai/t/add-new-trigger-and-icons-question-path-vs-base64-encoded/30399/3 "2023-02-22T21:27:12Z")

</div>

currently the icon\_path variable is only used in script widgets, but not available in the add\_new\_trigger functions.

It's quite easy to get the base64 for a specific file in Apple Script though:

```auto
set base64Encoded to do shell script "base64 -i /Users/youruser/somfile.jpg"

```

---

<div class="post-metadata">

**Author:** ![timbot](https://community.folivora.ai/user_avatar/community.folivora.ai/timbot/32/24281_2.png) [@timbot](https://community.folivora.ai/u/timbot)\
**Post date:** [February 23, 2023, 1:09am UTC](https://community.folivora.ai/t/add-new-trigger-and-icons-question-path-vs-base64-encoded/30399/4 "2023-02-23T01:09:24Z")

</div>

oh awesome, thank you!! gonna try that now
