MrSimonC / Toggle-Mac-Function-Keys

This AppleScript allows you to automate the toggling of using Function Keys vs Media Keys on MacOS
MIT License
86 stars 15 forks source link

Suggestions to run the script in the background without opening the UI #8

Closed hdecoded closed 1 year ago

hdecoded commented 1 year ago

Hi,

I am running the script using Raycast but I want it to run in the background without opening any UI. Is that possible?

Can you please point me in the right direction.

MrSimonC commented 1 year ago

Hi! That's really tricky. I've looked into other CLI scripts in the past, but they tend to break / they work until you have to reboot etc. This (painful) AppleScript only works by awkwardly using the UI - so what you're asking for is kinda possible, but not using AppleScript (that I know of)... for me, I trigger this script, then just wait a few seconds and the UI does it's thing, then closes ... which is good enough for me.

If you do find a solution - do let me know. good luck! 👍🏻