Problems with AppleScripts

Using Macbook pro 16 2021 M1 Max 32 GB, Sonoma 14.7.1 and BTT 4.879

Let's say that I want to run this simple AppleScript every time I press Cmd+F12:

tell application "TextEdit" to activate
return 1

If I copy/paste the code using the "Source Type: Apple Script" it works fine (TextEdit is launched every time I press the shortcut):

But if I use "Source Type: Apple Script From SCPT File", it never works:

This is a big problem to me as I have a lot of actions in BTT using scpt files as source.

I guess this is not a bug of BTT. I think it should be a problem of my Sonoma configuration, maybe permissions, I don't know…

Last week I installed Sonoma in my macbook pro (a clean installation), so I have installed again all software and files after that.

I have given all permissions to BTT (full access to disk, accessibility, etcetera).

I have tried several things and looking for information, but I am totally lost.

@Andreas_Hegenberg do you have some idea of what I can do? Do you think it could be a permissions issue?

*I have the same problem with another application that run AppleScripts (the app is Bome Midi Translator Pro). So it seems the problem is execute scpt files from another applications.

**The problem is the same if I use "AppleScript (Blocking)" or "AppleScript (Async in Background)"

Mhm I can reproduce the issue, but it works if I press the "Run Script" button in the UI.

I'd say it's a BTT bug because I recently refactored this stuff a lot. (The recommended way for BTT is to use the external file option now


)

I'll have a look!

I think 4.880 should fix the scpt issue (uploading now, thanks for reporting!)

1 Like

Downloaded version 4.881 and the problem has been fixed. Great!!

If I select "Source Type: Apple Script" option, I select "External File (Choose existing)", and I select the external scpt file in the desktop, it doesn't work.

that option is only for raw text files, scpt is some special format

So, if I want to execute an AppleScript external file, I must select the action "Run Apple Script (Blocking)" or "Run Apple Script (Async in Background)" as always, is it correct?

Yes to run an SCPT file just do it like before. However you can also just save your apple scripts to a normal text file. In that case you'd still use the same actions but use this selection:

With that option you can either edit it in any text editor (the changes will immediately show up in BTT) or directly in BTT.

1 Like

Ok, thanks for the explanation.

The difference between using external scpt files versus external text files is just the method?

I mean: there is a better performance using text files?

Performance is pretty much the same. It's just that it's easier to handle because you will see the contents of the script in BTT (and can use any code editor to edit them).

1 Like

Thanks! Understood!