# \#applescript

**URL:** https://community.folivora.ai/tag/applescript/19.md

[Latest](https://community.folivora.ai/latest.md) · [Categories](https://community.folivora.ai/categories.md) · [Tags](https://community.folivora.ai/tags.md)

---

## [Windows-like Minimize toggle on Dock icons](https://community.folivora.ai/t/windows-like-minimize-toggle-on-dock-icons/39494)

<div class="topic-metadata">

**Author:** [@Andreas\_Jakobsson](https://community.folivora.ai/u/Andreas_Jakobsson)\
**Replies:** 38\
**Last updated:** [October 19, 2026, 12:12pm UTC](https://community.folivora.ai/t/windows-like-minimize-toggle-on-dock-icons/39494 "2026-10-19T12:12:08Z")

</div>

The script aims to replicate a Windows-like behavior for clicking on dock icons in macOS. When one (1) app Window: When an app is open but minimized, clicking its dock icon will unminimize and bring the app window to …

---

## [BTT: \`get\_string\_variable\` crashes BetterTouchTool when the name exists only as a number variable](https://community.folivora.ai/t/btt-get-string-variable-crashes-bettertouchtool-when-the-name-exists-only-as-a-number-variable/47551)

<div class="topic-metadata">

**Author:** [@mrwildenfree](https://community.folivora.ai/u/mrwildenfree)\
**Replies:** 1\
**Last updated:** [August 11, 2026, 5:33pm UTC](https://community.folivora.ai/t/btt-get-string-variable-crashes-bettertouchtool-when-the-name-exists-only-as-a-number-variable/47551 "2026-08-11T17:33:02Z")

</div>

Version: BetterTouchTool 6.706 (build 2026080706) macOS: 27.0 beta (26A5388g), Apple M3 Max Summary Calling the AppleScript command get\_string\_variable with a variable name that exists only in BTT's number namespace ra…

---

## [Rewind by 15 seconds or skip by 15 seconds the audio transcript within the Notes App](https://community.folivora.ai/t/rewind-by-15-seconds-or-skip-by-15-seconds-the-audio-transcript-within-the-notes-app/47136)

<div class="topic-metadata">

**Author:** [@Vladormir](https://community.folivora.ai/u/Vladormir)\
**Replies:** 1\
**Last updated:** [May 31, 2026, 5:36pm UTC](https://community.folivora.ai/t/rewind-by-15-seconds-or-skip-by-15-seconds-the-audio-transcript-within-the-notes-app/47136 "2026-05-31T17:36:41Z")

</div>

Hi! After tinkering with AppleScripts (and some insight from ChatGPT to properly target buttons), these are 2 scripts : One for +15 seconds (that I'll bind to F10) One for -15 seconds (that I'll bind to F8) For +15 s…

---

## [\[Tip\] Fast User Switching on macOS Sonoma/Sequoia using AppleScript (The "Tab-Space" Method)](https://community.folivora.ai/t/tip-fast-user-switching-on-macos-sonoma-sequoia-using-applescript-the-tab-space-method/47015)

<div class="topic-metadata">

**Author:** [@mira](https://community.folivora.ai/u/mira)\
**Replies:** 0\
**Last updated:** [May 12, 2026, 10:07pm UTC](https://community.folivora.ai/t/tip-fast-user-switching-on-macos-sonoma-sequoia-using-applescript-the-tab-space-method/47015 "2026-05-12T22:07:58Z")

</div>

Hi everyone, Since Apple removed the sac\_switchuser function and the old CGSession binary no longer works on recent macOS versions (Sonoma/Sequoia), it has become quite difficult to trigger a specific user switch via a …

---

## ['Set input volume to zero' option is not working on the 'toggle mute microphone' action.](https://community.folivora.ai/t/set-input-volume-to-zero-option-is-not-working-on-the-toggle-mute-microphone-action/46742)

<div class="topic-metadata">

**Author:** [@colings86](https://community.folivora.ai/u/colings86)\
**Replies:** 5\
**Last updated:** [April 14, 2026, 1:41pm UTC](https://community.folivora.ai/t/set-input-volume-to-zero-option-is-not-working-on-the-toggle-mute-microphone-action/46742 "2026-04-14T13:41:48Z")

</div>

Describe the bug I have a trigger which toggles the mute for my microphone because the trigger uses an Apple Script widget on the stream deck to show the current state of the microphone. I also check the "Set input volu…

---

## [get\_dock\_badge\_for stops getting correct data after a while](https://community.folivora.ai/t/get-dock-badge-for-stops-getting-correct-data-after-a-while/46030)

<div class="topic-metadata">

**Author:** [@frex](https://community.folivora.ai/u/frex)\
**Replies:** 2\
**Last updated:** [April 12, 2026, 2:33pm UTC](https://community.folivora.ai/t/get-dock-badge-for-stops-getting-correct-data-after-a-while/46030 "2026-04-12T14:33:46Z")

</div>

Describe the bug I’m using code like these to check if Slack/Mail has unread every 2s and show alternative menubar icons. if application "Slack" is running then tell application "BetterTouchTool" set badgeNumber to …

---

## [Menubar Icon disappeared](https://community.folivora.ai/t/menubar-icon-disappeared/46404)

<div class="topic-metadata">

**Author:** [@sjung](https://community.folivora.ai/u/sjung)\
**Replies:** 3\
**Last updated:** [March 6, 2026, 3:17pm UTC](https://community.folivora.ai/t/menubar-icon-disappeared/46404 "2026-03-06T15:17:14Z")

</div>

Note: Yes, I did update to latest Alpha version and also did extensive tries to restore the icon. Describe the bug The icon in the menubar suddenly disappeared and has been missing since. Tried every different settin…

---

## [Restart app and re-open documents](https://community.folivora.ai/t/restart-app-and-re-open-documents/44951)

<div class="topic-metadata">

**Author:** [@Pal](https://community.folivora.ai/u/Pal)\
**Replies:** 1\
**Last updated:** [September 2, 2025, 8:03am UTC](https://community.folivora.ai/t/restart-app-and-re-open-documents/44951 "2025-09-02T08:03:20Z")

</div>

I've got this applescript to restart an application that I use frequently (for instance after installing fonts). Is there a smart and smooth way to extend it to also re-open all documents it had open? Or would that be to…

---

## [Problems launching AppleScript (silently fails)](https://community.folivora.ai/t/problems-launching-applescript-silently-fails/44404)

<div class="topic-metadata">

**Author:** [@milosz](https://community.folivora.ai/u/milosz)\
**Replies:** 3\
**Last updated:** [July 14, 2025, 10:13am UTC](https://community.folivora.ai/t/problems-launching-applescript-silently-fails/44404 "2025-07-14T10:13:15Z")

</div>

I have problem running the following script via BTT: tell application "System Events" tell process "Safari Technology Preview" click menu item "Open in New Tabs" of menu 1 of menu item "ACC" of menu 1 of menu item "Fa…

---

## [AppleScript permission issue](https://community.folivora.ai/t/applescript-permission-issue/44353)

<div class="topic-metadata">

**Author:** [@drun555](https://community.folivora.ai/u/drun555)\
**Replies:** 6\
**Last updated:** [July 9, 2025, 10:43am UTC](https://community.folivora.ai/t/applescript-permission-issue/44353 "2025-07-09T10:43:42Z")

</div>

Archive.zip (310.8 KB) I wrote a pretty simple AppleScript to fire up dictation tool: Unfortunately, It doesn't work. I traced the error in the Console.app: So it's a permission issue. I tried to reset permissio…

---

## [Using AppleScript with Shared Secret giving me syntax error](https://community.folivora.ai/t/using-applescript-with-shared-secret-giving-me-syntax-error/44328)

<div class="topic-metadata">

**Author:** [@sagar1996](https://community.folivora.ai/u/sagar1996)\
**Replies:** 1\
**Last updated:** [July 7, 2025, 8:23am UTC](https://community.folivora.ai/t/using-applescript-with-shared-secret-giving-me-syntax-error/44328 "2025-07-07T08:23:47Z")

</div>

I have the following AppleScript but I keep getting syntax error when trying to add shared\_secret: if output volume of (get volume settings) \> 0 then tell application "BetterTouchTool" shared\_secret "123" trigger\_actio…

---

## [Script in floating menu item dissappear / filled with null char ^@](https://community.folivora.ai/t/script-in-floating-menu-item-dissappear-filled-with-null-char/43537)

<div class="topic-metadata">

**Author:** [@xidiot](https://community.folivora.ai/u/xidiot)\
**Replies:** 9\
**Last updated:** [May 14, 2025, 8:20am UTC](https://community.folivora.ai/t/script-in-floating-menu-item-dissappear-filled-with-null-char/43537 "2025-05-14T08:20:07Z")

</div>

If I edit an existing applescript (external file) here: it seems that the changes are saved, but if I close BTT config window or simply click on another menu item (or anything else which will move away from this conf…

---

## [Apple Script does not launch](https://community.folivora.ai/t/apple-script-does-not-launch/43495)

<div class="topic-metadata">

**Author:** [@Evg2000](https://community.folivora.ai/u/Evg2000)\
**Replies:** 9\
**Last updated:** [May 4, 2025, 10:38pm UTC](https://community.folivora.ai/t/apple-script-does-not-launch/43495 "2025-05-04T22:38:20Z")

</div>

Hello everyone! Just purchased recently the app. Actually everything works cool except Apple Scripts. I created a script, checked it separately - it works OK. Then i try to attach it to the hotkey. And... it attaches, b…

---

## [Hovered UI AX value as a Variable?](https://community.folivora.ai/t/hovered-ui-ax-value-as-a-variable/42722)

<div class="topic-metadata">

**Author:** [@frankmak](https://community.folivora.ai/u/frankmak)\
**Replies:** 2\
**Last updated:** [March 8, 2025, 7:35pm UTC](https://community.folivora.ai/t/hovered-ui-ax-value-as-a-variable/42722 "2025-03-08T19:35:46Z")

</div>

I have been slightly losing my mind trying to figure this out so I would REALLY appreciate any help :pray: As the title suggests, I want to grab a Hover UI Element value, specifically the "AXTitle" value, so I can use t…

---

## [Inconsistent variable behavior when switching variable between string, number, persistent\_string, and persistent\_number](https://community.folivora.ai/t/inconsistent-variable-behavior-when-switching-variable-between-string-number-persistent-string-and-persistent-number/42707)

<div class="topic-metadata">

**Author:** [@pure\_pacific](https://community.folivora.ai/u/pure_pacific)\
**Replies:** 0\
**Last updated:** [March 6, 2025, 10:41pm UTC](https://community.folivora.ai/t/inconsistent-variable-behavior-when-switching-variable-between-string-number-persistent-string-and-persistent-number/42707 "2025-03-06T22:41:15Z")

</div>

Variable behavior is not consistent when using the same variable name for different permutations of set\_string\_variable, set\_number\_variable, and their persistent variations. It is easiest to show this via JXA (use the R…

---

## [AppleScript: \`reveal\_element\_in\_ui\` does not accept \`shared\_secret\`](https://community.folivora.ai/t/applescript-reveal-element-in-ui-does-not-accept-shared-secret/42662)

<div class="topic-metadata">

**Author:** [@pure\_pacific](https://community.folivora.ai/u/pure_pacific)\
**Replies:** 1\
**Last updated:** [March 4, 2025, 10:44am UTC](https://community.folivora.ai/t/applescript-reveal-element-in-ui-does-not-accept-shared-secret/42662 "2025-03-04T10:44:26Z")

</div>

Describe the bug reveal\_element\_in\_ui does not accept shared\_secret as a parameter. If a secret is set, the AppleScript fails when shared\_secret is included and prompts for secret when shared\_secret is omitted. Ideally,…

---

## [Best Practices for Securely Storing API Keys & Passwords in BTT Scripts](https://community.folivora.ai/t/best-practices-for-securely-storing-api-keys-passwords-in-btt-scripts/42420)

<div class="topic-metadata">

**Author:** [@fortred2](https://community.folivora.ai/u/fortred2)\
**Replies:** 10\
**Last updated:** [February 20, 2025, 11:05am UTC](https://community.folivora.ai/t/best-practices-for-securely-storing-api-keys-passwords-in-btt-scripts/42420 "2025-02-20T11:05:40Z")

</div>

Hello BTT Community, I frequently use BetterTouchTool’s scripting actions—Run Real JavaScript, Run JavaScript for Automation, and Run AppleScript—and they’ve been incredibly powerful. However, I haven’t found any inform…

---

## [Calling \`reveal\_element\_in\_ui\` for Triggers in All Apps doesn't work](https://community.folivora.ai/t/calling-reveal-element-in-ui-for-triggers-in-all-apps-doesnt-work/42099)

<div class="topic-metadata">

**Author:** [@fortred2](https://community.folivora.ai/u/fortred2)\
**Replies:** 2\
**Last updated:** [February 6, 2025, 10:51am UTC](https://community.folivora.ai/t/calling-reveal-element-in-ui-for-triggers-in-all-apps-doesnt-work/42099 "2025-02-06T10:51:00Z")

</div>

Describe the bug Calling tell application "BetterTouchTool" to reveal\_element\_in\_ui "\[...\]" doesn't work if the Trigger UUID is in "For All Apps" i.e. global. It does work if the Trigger associated with an app or CAG. I…

---

## [ChatGPT Action Fails to Return "Long" Response.](https://community.folivora.ai/t/chatgpt-action-fails-to-return-long-response/42116)

<div class="topic-metadata">

**Author:** [@R\_Mutt](https://community.folivora.ai/u/R_Mutt)\
**Replies:** 6\
**Last updated:** [February 5, 2025, 12:54pm UTC](https://community.folivora.ai/t/chatgpt-action-fails-to-return-long-response/42116 "2025-02-05T12:54:04Z")

</div>

It seems that when the response is long, BTT never returns the output. Is there any limit set for the length of the output? It seems to be happening both when calling the action from a script (like this) and in the BTT …

---

## [Applescript Widget Stops Showing and Disapears on Firefox--Reappears upon touching Touchbar](https://community.folivora.ai/t/applescript-widget-stops-showing-and-disapears-on-firefox-reappears-upon-touching-touchbar/41683)

<div class="topic-metadata">

**Author:** [@wynstaxxx](https://community.folivora.ai/u/wynstaxxx)\
**Replies:** 4\
**Last updated:** [January 17, 2025, 1:48am UTC](https://community.folivora.ai/t/applescript-widget-stops-showing-and-disapears-on-firefox-reappears-upon-touching-touchbar/41683 "2025-01-17T01:48:40Z")

</div>

Have two (2) different applescripts that I use for browser apps, specifically Firefox Nightly to display the current url (hostname) and title of current webpage I am browsing on. Everything was working and is kindof is,…

---

## [Floating menu script not always updating and getting stuck. Restarting BTT fixes.](https://community.folivora.ai/t/floating-menu-script-not-always-updating-and-getting-stuck-restarting-btt-fixes/37684)

<div class="topic-metadata">

**Author:** [@gecko](https://community.folivora.ai/u/gecko)\
**Replies:** 92\
**Last updated:** [December 16, 2024, 12:21am UTC](https://community.folivora.ai/t/floating-menu-script-not-always-updating-and-getting-stuck-restarting-btt-fixes/37684 "2024-12-16T00:21:43Z")

</div>

Describe the bug Floating menu script not always updating and getting stuck. Not sure if bug, or else is there a way to force an update? I have a floating menu behind the Notch that uses Applescripts to launch and play…

---

## [HUD Overlays in AppleScript](https://community.folivora.ai/t/hud-overlays-in-applescript/40916)

<div class="topic-metadata">

**Author:** [@lukasvac](https://community.folivora.ai/u/lukasvac)\
**Replies:** 2\
**Last updated:** [December 8, 2024, 1:23pm UTC](https://community.folivora.ai/t/hud-overlays-in-applescript/40916 "2024-12-08T13:23:32Z")

</div>

Hi, Is it possible to generate a HUD Overlay within the "Run Apple Script" action? Alternatively, can I create a global variable from the script's result, pass it back to BTT, and then use it in an additional action to …

---

## [ocr Implementing fast OCR using scripts.](https://community.folivora.ai/t/ocr-implementing-fast-ocr-using-scripts/40887)

<div class="topic-metadata">

**Author:** [@louishino](https://community.folivora.ai/u/louishino)\
**Replies:** 0\
**Last updated:** [December 6, 2024, 10:08pm UTC](https://community.folivora.ai/t/ocr-implementing-fast-ocr-using-scripts/40887 "2024-12-06T22:08:20Z")

</div>

Essentially, this is an OCR that utilizes the built-in Preview function on Mac. We simply bind this operation to a keyboard shortcut, mouse gesture, or side button. Personally, I prefer using Shift + Cmd + Z because it's…

---

## [Keyboard-centric: Copying / Moving Files in Finder "List" View Using only the Keyboard](https://community.folivora.ai/t/keyboard-centric-copying-moving-files-in-finder-list-view-using-only-the-keyboard/40414)

<div class="topic-metadata">

**Author:** [@proactivematter](https://community.folivora.ai/u/proactivematter)\
**Replies:** 0\
**Last updated:** [November 20, 2024, 5:44pm UTC](https://community.folivora.ai/t/keyboard-centric-copying-moving-files-in-finder-list-view-using-only-the-keyboard/40414 "2024-11-20T17:44:47Z")

</div>

Hey all, I use Finder exclusively in List view and enjoy the ability to toggle nested folders without having to actually enter said folders. With a mouse, this makes it possible to move files around without having to ju…

---

## [MPV Player: Run Apple Script not running my script anymore](https://community.folivora.ai/t/mpv-player-run-apple-script-not-running-my-script-anymore/38497)

<div class="topic-metadata">

**Author:** [@mkozjak](https://community.folivora.ai/u/mkozjak)\
**Replies:** 10\
**Last updated:** [November 12, 2024, 7:17pm UTC](https://community.folivora.ai/t/mpv-player-run-apple-script-not-running-my-script-anymore/38497 "2024-11-12T19:17:36Z")

</div>

This trigger isn't running the script anymore. I'm running version 4.637. This used to work sometime in the past. (btw I also cannot turn off "run in background (limited support)". it just reenables itself on each S…

---

## [is there a way to trigger actions for predefined hotkeys in certain, but not all, websites within safari ?](https://community.folivora.ai/t/is-there-a-way-to-trigger-actions-for-predefined-hotkeys-in-certain-but-not-all-websites-within-safari/40108)

<div class="topic-metadata">

**Author:** [@mohshehab](https://community.folivora.ai/u/mohshehab)\
**Replies:** 1\
**Last updated:** [November 4, 2024, 2:44pm UTC](https://community.folivora.ai/t/is-there-a-way-to-trigger-actions-for-predefined-hotkeys-in-certain-but-not-all-websites-within-safari/40108 "2024-11-04T14:44:08Z")

</div>

I'm trying to benefit from the hotkeys provided by certain websites like Youtube, but I don't want it to affect other websites behaviors, just conditioned to work when browsing certain website, is there a way to do it ?

---

## [Where are scripts stored?](https://community.folivora.ai/t/where-are-scripts-stored/38914)

<div class="topic-metadata">

**Author:** [@tistos](https://community.folivora.ai/u/tistos)\
**Replies:** 7\
**Last updated:** [September 25, 2024, 3:08pm UTC](https://community.folivora.ai/t/where-are-scripts-stored/38914 "2024-09-25T15:08:37Z")

</div>

I recently extened a script that I trigger with a keyboard shortcut but today I find that it somehow went back to the earlier version (i.e. without the new code). Since I am syncing my settings via Dropbox, I suspected a…

---

## [Apple Script causes the app to reopen when attempting to quit](https://community.folivora.ai/t/apple-script-causes-the-app-to-reopen-when-attempting-to-quit/39211)

<div class="topic-metadata">

**Author:** [@HackettLai](https://community.folivora.ai/u/HackettLai)\
**Replies:** 4\
**Last updated:** [September 17, 2024, 1:51pm UTC](https://community.folivora.ai/t/apple-script-causes-the-app-to-reopen-when-attempting-to-quit/39211 "2024-09-17T13:51:45Z")

</div>

Describe the bug I have an Apple Script to gather information from Spotify. After updating to the latest macOS Sequoia 15.0, I've noticed that this script may occasionally cause Spotify to reopen itself when attempting …

---

## [How can I set the text color base on the wallpaper?](https://community.folivora.ai/t/how-can-i-set-the-text-color-base-on-the-wallpaper/39064)

<div class="topic-metadata">

**Author:** [@HackettLai](https://community.folivora.ai/u/HackettLai)\
**Replies:** 0\
**Last updated:** [September 7, 2024, 9:05am UTC](https://community.folivora.ai/t/how-can-i-set-the-text-color-base-on-the-wallpaper/39064 "2024-09-07T09:05:45Z")

</div>

I've noticed that Apple automatically adjusts the menu bar icon/text color to black or white based on the wallpaper. How can I implement a similar feature for my floating menu? Currently, it can be difficult to read wit…

---

## [Created Named Trigger variable but get\_string\_variable failed as trigger not active](https://community.folivora.ai/t/created-named-trigger-variable-but-get-string-variable-failed-as-trigger-not-active/39031)

<div class="topic-metadata">

**Author:** [@Stacey\_Marshall](https://community.folivora.ai/u/Stacey_Marshall)\
**Replies:** 3\
**Last updated:** [September 5, 2024, 1:00pm UTC](https://community.folivora.ai/t/created-named-trigger-variable-but-get-string-variable-failed-as-trigger-not-active/39031 "2024-09-05T13:00:51Z")

</div>

I created a Named Trigger: emacsclient which consists very simply with the following settings: tell application "BetterTouchTool" trigger\_action "{ BTTActionCategory: 0, BTTPredefinedActionType: 292, BTTPredefined…

[Next page](https://community.folivora.ai/tag/applescript/19.md?match_all_tags=true&page=1&tags%5B%5D=applescript)
