Applescript problem

Tried with another script, and it works…
Can’t figure out the common thread…

Weirder still :
I managed to create the Bome file I want with all scripts working on the older OS X version and the trial of Bome, and it works there. I moved the project file to the 11.5 computer with the non-trial version of Bome, and it fails with the same errors…
???

Oh, sorry, the error message was different, and I fixed it. So, the file created on the older OS X works on the newer one.

Hi, thanks a lot for these tests. Can you please post the file that has failing scripts and the exact error message? Thanks!

test bome.bmtp (6.7 KB)
fader stan fail.bmtp (7.6 KB)

Test Bome is the working one.

I have a feeling that the error is related to the pagecode (I use a french canadian keyboard), maybe the double quote symbol, but I have trouble isolating the issue.

Indeed! From your failing one:
if q type of eachCue is "Audio" or q type of eachCue is “Fade” and q name of eachCue contains "#7" then

As you can see (here), “Fade” is using typographic quotes. That may or may not be a problem with the keyboard. In general, the straight quotes " are the correct ones in AppleScript.
Unfortunately, that’s not so easy to see in MIDI Translator Pro. If in doubt, copy a straight quote from e.g. this forum, and then paste over the typographic quotes.

Most word processors will replace straight quotes by typographic quotes, even this forum does so unless formatted as code with back ticks.

I hope this solves some of the problems!

Well,

Not really, it was still throwing the error with code that uses no quotes. Somehow, after it throws the first error (because of the wrong quote?), it keeps throwing the error, even if the quote is removed.

Also, the quotes from my keyboard pose no issue to the code editor built in QLab, or Apple’s script editor. I don’t really know what the difference is with Bome MT.

Maybe the issue is completely unrelated to the quotes, or the keyboard, or the codepage, Steve is also having the issue, and I doubt he is using a canadian french keyboard.

One thing to know: MT Pro will compile ALL AppleScript sections (Project, and all translators using Apple Script outgoing action) into one big AppleScript and compile that. So as long as at least one AppleScript section in MT Pro does not work, no AppleScript will work.

I’m not using French-Canadian keyboard but will have a look at the quotes being used.

I’m not persuaded he has the same issue? His error message seemed different.

Stan, I think one or more of your AppleScript sections use two ‘tell’ statements, but only one ‘end tell’:

tell application id "com.figure53.QLab.4" to tell front workspace
end tell

I’m not an AppleScript expert, but it seems that there is an ‘end tell’ missing. How about this one:

tell application id "com.figure53.QLab.4" to
    tell front workspace
    end tell
end tell

My quotes look like straight quotes. I’m using US keyboard.

Applescript-test-2021-07-27.bmtp (1.3 KB)

Moving the handler to the global header fixed my issue.

I was prompted (once) to provide permissions, but that is it.

@FlorianBome So, if I push the Test button to test a script, but some other script still has a typo, it will fail because of the other bad script?

correct. This is inconvenient for developing the translation project (apologies!), but it’s much nicer on CPU and memory usage.

Ok,

This explains why I was getting errors even if I was completely simplifying one of the scripts as a test, without correcting the others that had errors in them.

Thanks!

Yes, it is probably best to test and debug your scripts in the script editor and when it is working, copy and paste (with the right type of quotes) into the outgoing action of Bome MIDI Translator Pro. It also looks like handlers should always be put in the global AppleScript section of MT Pro.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz