# Can BTT execute/run Swift scripts?

**URL:** <https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640>\
**Category:** Configuration Help & General Discussion\
**Created:** [August 24, 2026, 7:41am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640 "2026-08-24T07:41:33Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [August 24, 2026, 7:41am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/1 "2026-08-24T07:41:33Z")

</div>

I haven't found a predefined action with that name.

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [August 24, 2026, 8:57am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/2 "2026-08-24T08:57:14Z")

</div>

Is this not suitable for you?

 ![image](https://community.folivora.ai/uploads/default/original/3X/4/0/4027e9742fd2e230db4ed4141c18b8528ee1b5bd.png)

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [August 24, 2026, 8:19pm UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/3 "2026-08-24T20:19:30Z")

</div>

Hi @xidiot do you mean just copying the script in there? Unfortunately, that doesn't work.

 ![image](https://community.folivora.ai/uploads/default/original/3X/5/3/53cda1f3945361196304b96bcff438fa41e0c02f.png)

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [August 24, 2026, 8:51pm UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/4 "2026-08-24T20:51:31Z")

</div>

Nope, use it like this:

`/usr/bin/swift $path_to_script.swift`

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [August 24, 2026, 8:54pm UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/5 "2026-08-24T20:54:12Z")

</div>

Please excuse my ignorance. Where should the script go, then?

---

<div class="post-metadata">

**Author:** ![xidiot](https://community.folivora.ai/user_avatar/community.folivora.ai/xidiot/32/27204_2.png) [@xidiot](https://community.folivora.ai/u/xidiot)\
**Post date:** [August 25, 2026, 6:39am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/6 "2026-08-25T06:39:29Z")

</div>

You need to save the script somewhere (this is `$path_to_script.swift`) and in the action itself under "Script" section you put `/usr/bin/swift $path_to_script.swift`, e.g. `/usr/bin/swift /Users/frank/scripts/myscript.swift`

---

<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:** [August 25, 2026, 11:05am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/7 "2026-08-25T11:05:18Z")

</div>

I have added an easier and more powerful way to run swift scripts in 6.755 - with the ability to use BTT's scripting functions from there as well:

> **[Using Swift | BetterTouchTool Documentation](https://docs.folivora.ai/docs/scripting/swift/)**
>
> Running Swift Scripts in BTT

The predefined action is called "Run Swift Script"

 ![image](https://community.folivora.ai/uploads/default/original/3X/6/2/62f3b7e154a7adbe568530c9fe8066b3b244f613.webp)

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [August 25, 2026, 11:26am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/8 "2026-08-25T11:26:21Z")

</div>

That sounds good, thanks. I can’t test it right now because I’m not at my computer. I asked because I received a set of swift scripts that do things which are otherwise not so easy to accomplish. For example, moving the mouse to the selected item in the Finder or another app.

However, people often point out a downside: Swift scripts are supposed to be much, much slower than others. Is that true? Or not with BTT?

---

<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:** [August 25, 2026, 11:30am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/9 "2026-08-25T11:30:56Z")

</div>

With the new action they will only be slow the very first time you use them. Then BTT keeps the compiled version cached making them faster than any other option.

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [August 25, 2026, 11:35am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/10 "2026-08-25T11:35:12Z")

</div>

yes, sorry, you already answer the question in the manual. I only just saw that now.

> [@Andreas\_Hegenberg](#):
>
> making them faster than any other option.

But what does that mean compared to other scripts?

---

<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:** [August 25, 2026, 11:37am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/11 "2026-08-25T11:37:29Z")

</div>

depends! 😅  
Probably faster for many things but this is not easy to answer for all cases. Some things might be slower or equal to other scripting types.

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [August 25, 2026, 11:42am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/12 "2026-08-25T11:42:48Z")

</div>

Depends … are you a lawyer? 😂

I’ve found a speed comparison. These results are shocking.

![image](https://community.folivora.ai/uploads/default/original/3X/1/7/1792c94e9da6d5e36174aca45d25830e7b2a5cb3.png)

Ah, but maybe that has to do with the fact that they only measured the first run.

---

<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:** [August 25, 2026, 11:48am UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/13 "2026-08-25T11:48:23Z")

</div>

yeah these measure the compile time, once compiled the swift result will be lower than AS and also lower then Shell for most/many scenarios

---

<div class="post-metadata">

**Author:** ![Robert\_Corlett](https://community.folivora.ai/user_avatar/community.folivora.ai/robert_corlett/32/3748_2.png) [@Robert\_Corlett](https://community.folivora.ai/u/Robert_Corlett)\
**Post date:** [September 12, 2026, 5:36pm UTC](https://community.folivora.ai/t/can-btt-execute-run-swift-scripts/47640/14 "2026-09-12T17:36:13Z")

</div>

Andreas you just keep giving us gifts!!  
Are you the only developer working on BTT? Your baby has grown to be one of the most sophisticated and functional applications of all time.

I remember when there was fear that Apple was planning on making MacOS more like iOS - locking down low levell APIs, 'foolproofing' the system by gatekeeping customization etc. Thankfully they didnt go in that direction, and I had a thought the other day that perhaps there are simply too many people at apple headquarters with dozens of bettertouchtool triggers they couldnt bear living without who put their foot down!!
