Dialog Toolkit Plus isMainThread Error

You renamed it or changed the script being called right?

I deleted the old one that’s in my Script Libraries folder, rebooted my computer, and renamed the new one to Dialog Toolkit Plus. I didn’t change the use statement in my script. I don’t have any other versions of Dialog Toolkit Plus on my computer (at least that I can find).

It shouldn’t work or is using another version…change your use script to use the filename I sent or rename mine to dialog toolkit plus. Sorry I should have said that earlier.

I’m a bit confused. The requirement to declare OSAAppleScriptObjCEnabled was removed from macOS way back in version 10.10. There’s no such Info.plist key as TemplateForCFBundleIdentifier, as far as I can see. And the WindowState entries are for the use of script editors only.

I think there’s something else happening on your system, but I’m not sure what.

Believe me I understand the confusion. Your old one and new plist are both in the file I sent. If you want I’ll send you a script I can reproduce it in but would would rather not post publicly.

I’ve looked the entries, and I’m not convinced. I guess there’s a slight chance that Apple is still doing the check for OSAAppleScriptObjCEnabled by mistake under some conditions, although that really sounds a very, very long shot. The other entries are effectively meaningless.

What OS version you running? When my app failed it was 100% of the time. I can send it to you if you can test and are on Ventura.

dean. I did delete Shane’s version of Dialog Toolkit Plus and renamed your version to Dialog Toolkit Plus.

Just to check this, I copied your version to another folder, deleted it from the Script Libraries folder, rebooted the computer, and then ran my script, which returned:

Error Number: -1728
Can’t get script “Dialog Toolkit Plus”.

I copied your version of Dialog Toolkit Plus back to the Script Libraries folder. I then ran my script which worked fine. So my search-and-replace script is now using your version of Dialog Toolkit Plus–at least as far as I can tell.

1 Like

Sorry, I’m just not in a position to do that sort of testing at the moment. I’m getting reports of intermittent errors, but no other reports of what you are suggesting, and the time I can devote to freeware is limited.

I understand…so let me ask you what sounds like a riddle but is a real question… If a script is calling a script (menubar triggered run script) or Fast Scripts calls a script…that uses your dialog toolkit plus. The dialog is looking for main thread, is it potentially just unpredictable because all 3 use a reference to current application’s NSThread? Maybe the WindowState or other items in the plist are resolving it?

The error is that AppleScript is not loading AppleScriptObjC. If I knew why, we wouldn’t be having this thread. The intermittent nature of the problem makes it difficult to solve – it has been happening for years, and no-one has come up with an explanation.

That said, there’s no reason for AppleScript to even read the Info.plist file, unless there’s been a regression with OSAAppleScriptObjCEnabled. And if that were the case, I’d expect it to be 100% reproducible. WindowState is a red herring (it’s the settings for Script Editor’s window when the script was last saved).

1 Like

I’ve been using dean’s revision of Shane’s script for two days and haven’t received the isMainThread error message even once. So, this issue appears resolved for me (hopefully). Many thanks!

1 Like

I’m glad it’s resolved. Same for me. I modified Myriad Tables Lib plist file to add the same

OSAAppleScriptObjCEnabled boolean yes

And it stopped causing the same problem. @ShaneStanley do you think this change is necessary in SMSTableDialogBuilder plist?

Try adding it and tell me. I can’t generate the problem with any regularity here.

It wasn’t necessary that I can see. Going to test for bit.

I’m not surprised. That value was introduced in 10.9 when ASObjC was first made available outside Xcode, and was dropped in 10.10 – that’s nine versions of the OS ago. It’s a long time for a regression to hang around (but then, this is AppleScript).

Im referring to it wasn’t necessary to add OSAAppleScriptObjCEnabled boolean yes to the SMSTableDialogBuilder plist file. Adding it to the Myriad tables 1.0.13 plist file has stopped it from causing the App to quit unexpectedly when triggering display table. FYI it happened more on M1 Mac Ventura then Intel Mac Ventura but still occurred and was resolved by adding that line to the plist.

Was that the only difference?

Yes. It was easier to test on Myriad Tables because the last 2 versions didn’t have that line in the plist file and they both quit until added.

I can strip down my code to send u for reference to test it but essentially I’m calling runscript from script A that runs code in script B and uses Dialog Toolkit Plus and Myriad Tables all running in Ventura on Intel and it happened 90% of time when not being run from script debugger. When I tested on M1 with a newer version of Ventura it did it 100% of time.

@ShaneStanley sent you a loom video of the error occurring and being fixed and no longer occurring.