Dialog Toolkit Plus isMainThread Error

That’s really only required for libs that load frameworks (so Myriad Tables, BridgePlus, etc).

1 Like

Thanks everyone for the responses. I’ve been working through dean’s suggestions, but the issue is so intermittant that it’s slow going.

I took dean’s advice and divided the displayDialog handler into try statements, and the script fails at the statement shown below. I have no idea why that would be the case. BTW, I’ve been running the script by way of a Script-Debugger key binding, so FastScripts is not involved.

	try
		set {theButtons, minWidth} to create buttons {"Cancel", "OK"} default button 2 cancel button 1 without equal widths
	on error
		display dialog "The buttons"
		error number -128
	end try

See if the error will return a partial result. That may help narrow things down more.

1 Like

The only thing I see different about the format we follow and code is

on create buttons buttonList button keys buttonKeysList : {} equal widths equalWidths : (false) default button okIndex : 0 cancel button cancelIndex : 0

has equal widths prior to the cancel and default buttons. It may be worth removing without equal widths to see if you still error.

Your problem is a known issue with AppleScriptObjC scripts on recents systems (not sure if it’s Catalina or Big Sur): the system randomly fails to load frameworks.

FastScript is not involved at all. But it has an advantage on other Script menus.
That’s why I recommended to check out your FastScripts version.

Do you remember this topic?

Thanks Jonas. I wasn’t aware (or didn’t recall) that there was a problem with recent systems failing to load frameworks. My script fails at the exact point where a Dialog Toolkit Plus command is first run, so what you say makes sense.

You guys jinxed me. Now Im having the same issue! @ShaneStanley — help! It’s only when calling a dialog using dialog toolkit plus v1.1.3. The error happens less when using 1.1.2.

Error -1708 : NSThread doesn’t understand the “isMainThread” message.

The change in version is pure co-incidence.

it may seem like one but when I use:

use script “Dialog Toolkit Plus”

and compile/save. I get error. When I have the 1.1.2 library in Script Libraries and named it differently…and

use script “Dialog Toolkit Plusv2”

compile and save. I don’t get the error.

@ShaneStanley so I tried experiment…and changed my script at beginning to use AppleScript 2.4 instead of using AppleScript 2.5. Then both Libraries error’d. Then switched back and now they both do. Do u think its related?

In a word, no. Compilation issues are completely unrelated.

@ShaneStanley Thanks for your patience…I have GREAT news!

So in further testing. This is what I figured out:

  1. v 1.1.2 original file dated 12/8 on my Mac in ~/Script Libraries it works fine on my Mac
  2. v 1.1.3 original downloaded it does not.
  3. If I duplicate the v 1.1.2 and resave it on my Mac Ventura 13.1 adding to name resaved. it errors.

So I looked at the differences…your old one had empty foundation folder…added same to new one nope didn’t work. Looked at the plist files and bingo different. I tried your old plist file and updated the version to match the latest you had saved and it works great not one problem.

So…If I use your plist file from v 1.1.2 update it to 1.1.3. It WORKS Perfect!!!

The extras are the differences…
OSAAppleScriptObjCEnabled
TemplateForCFBundleIdentifier
and the 8 items under WindowState

I think the reason you’re unable to simulate/test is because a test script runs. But if you ran that script from another script it would not…ie: FastScripts or Menubar apps or Scripts running other scripts and gets the original error from the original version 1.1.3. I’m sending the updated version with the plist to u now.

dean. I don’t completely understand what changes you’ve made. Is there some way for me to test this? Or should I just wait while you and Shane resolve this? Thanks.

Here’s the zipped file you can test.

Dialog Toolkit PlusUpdated.zip (110.6 KB)

Thanks. I replaced the old one with the updated version, which seems to work fine. I only encounter this issue once or twice a day, and I’ll report back after a day or so,

1 Like

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.