# AppleScript in widgets running when widget not visible?

**URL:** <https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080>\
**Category:** Configuration Help & General Discussion\
**Tags:** touch-bar\
**Created:** [August 21, 2018, 4:29pm UTC](https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080 "2018-08-21T16:29:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![richtack](https://community.folivora.ai/user_avatar/community.folivora.ai/richtack/32/1244_2.png) [@richtack](https://community.folivora.ai/u/richtack)\
**Post date:** [August 21, 2018, 4:29pm UTC](https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080/1 "2018-08-21T16:29:57Z")

</div>

I have been really customizing my Touch Bar lately, and having a lot of fun. But I notice that BTT uses "significant energy" on the laptop. I suspect it's because i'm using a number of Applescript Widgets.

Before I start cleaning up, I had a meta-question about how BTT works.

I have a number of touch bar Widgets "Run Apple Script and Show Results" that are not currently Visible. Either because they are old and i'm not currently using them so I have unchecked "Visible", or because they are not currently active (they are in a Button Group not currently active, or they only show with a modifier button).

My questions is, are these applescripts all running at the "Execute every x seconds" setting, even when they are not visible? if that's the case, then I really know what my energy problem is!

Thanks,  
Rich

---

<div class="post-metadata">

**Author:** ![GoldenChaos](https://community.folivora.ai/user_avatar/community.folivora.ai/goldenchaos/32/23617_2.png) [@GoldenChaos](https://community.folivora.ai/u/GoldenChaos)\
**Post date:** [August 21, 2018, 4:47pm UTC](https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080/2 "2018-08-21T16:47:04Z")

</div>

@Andreas_Hegenberg double checked this while we were fine-tuning energy usage of my preset, so I can confirm that scripts that are not visible _do not_ run; the issue is certainly with one of your currently visible scripts. In my case it turned out to be a combination of two system events scripts that were taking up a lot of resources, so I removed one and lowered the other from 1s to 5s.

---

<div class="post-metadata">

**Author:** ![richtack](https://community.folivora.ai/user_avatar/community.folivora.ai/richtack/32/1244_2.png) [@richtack](https://community.folivora.ai/u/richtack)\
**Post date:** [August 21, 2018, 4:58pm UTC](https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080/3 "2018-08-21T16:58:14Z")

</div>

that's really good to know, thanks!

I wonder if my current system is just too much:  
4 x 1s - "play/pause," "next track," "skip track", "mute", Spotify  
2 x 5s - check for notifications, check wifi network  
2 x 60s - check next event, weather

I would love to dial down the 1-second widgets, but it feels like I need the fast refresh rate when it comes to the responsiveness of audio.

any non-official opinions welcome!

---

<div class="post-metadata">

**Author:** ![GoldenChaos](https://community.folivora.ai/user_avatar/community.folivora.ai/goldenchaos/32/23617_2.png) [@GoldenChaos](https://community.folivora.ai/u/GoldenChaos)\
**Post date:** [August 21, 2018, 5:05pm UTC](https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080/4 "2018-08-21T17:05:03Z")

</div>

Those settings actually look fine to me, no clue why you're seeing poor performance then ¯\_(ツ)\_/¯

---

<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 21, 2018, 6:31pm UTC](https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080/5 "2018-08-21T18:31:37Z")

</div>

If possible, post an export of your preset here or upload it via [share.folivora.ai](http://share.folivora.ai), then I can check.

---

<div class="post-metadata">

**Author:** ![richtack](https://community.folivora.ai/user_avatar/community.folivora.ai/richtack/32/1244_2.png) [@richtack](https://community.folivora.ai/u/richtack)\
**Post date:** [August 21, 2018, 6:49pm UTC](https://community.folivora.ai/t/applescript-in-widgets-running-when-widget-not-visible/3080/6 "2018-08-21T18:49:53Z")

</div>

Andreas, I uploaded it to:  
[https://share.folivora.ai/sharedPreset/16be4e59-7d7f-46b5-ac5d-7f78c45ed4d8](https://share.folivora.ai/sharedPreset/16be4e59-7d7f-46b5-ac5d-7f78c45ed4d8)

I _think_ I did it correctly, but i'm new to this, so let me know. I think in uploading everything (like in life), i've once again over-shared.  
🙂  
Rich
