# Script to restart bettertouchtool app

**URL:** <https://community.folivora.ai/t/script-to-restart-bettertouchtool-app/13657>\
**Category:** Configuration Help & General Discussion\
**Created:** [February 13, 2020, 2:05am UTC](https://community.folivora.ai/t/script-to-restart-bettertouchtool-app/13657 "2020-02-13T02:05:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![klamike](https://community.folivora.ai/user_avatar/community.folivora.ai/klamike/32/11779_2.png) [@klamike](https://community.folivora.ai/u/klamike)\
**Post date:** [February 13, 2020, 2:05am UTC](https://community.folivora.ai/t/script-to-restart-bettertouchtool-app/13657/1 "2020-02-13T02:05:22Z")

</div>

When right-clicking on the bettertouchtool icon in the dock there is an option to Restart App. I would like to have this functionality in my menu bar and to implement that I was wondering if it would be possible to create (or if there exists) a bash script to trigger that function.

---

<div class="post-metadata">

**Author:** ![CJK](https://community.folivora.ai/user_avatar/community.folivora.ai/cjk/32/723_2.png) [@CJK](https://community.folivora.ai/u/CJK)\
**Post date:** [February 14, 2020, 5:44am UTC](https://community.folivora.ai/t/script-to-restart-bettertouchtool-app/13657/2 "2020-02-14T05:44:45Z")

</div>

Here's a little function that you can use to do that:

```auto
restart () {
	local A
	(( $# )) && for A in "$@"
	do (
		pkill -xi "$A"
		open -ga "$A"
	) &> /dev/null ; done || reboot
}

```

To use, just send the names of the applications you wish to (re)start as command-line parameters, e.g. `restart "Better Touch Tool"` (is it three words?)

---

<div class="post-metadata">

**Author:** ![klamike](https://community.folivora.ai/user_avatar/community.folivora.ai/klamike/32/11779_2.png) [@klamike](https://community.folivora.ai/u/klamike)\
**Post date:** [February 14, 2020, 10:04pm UTC](https://community.folivora.ai/t/script-to-restart-bettertouchtool-app/13657/3 "2020-02-14T22:04:33Z")

</div>

Thanks so much this works perfectly!
