Dialog Toolkit Plus 1.1.3 'NSThread doesn't understand the "isMainThread" message.'

I encountered this error after a minor edit ( added an entry to a list of strings ) to a script app that utilizes DTP 1.1.3. I’ve included the library in the script app resources and had absolutely no issues with my team using this app on various systems OS versions etc. for several months.

The un-edited version of the app still launches and runs properly.

This error does not occur running the app in Script Debugger but appears when the app is launched. I could find no fix but reverting to 1.1.2 which does allow the app to run normally.

Is there a known cause or resolution for this on DTP 1.1.3?

Not that I’m aware of. The usual causes of that error are either the use framework "Foundation" statement missing, or AppleScript having a hissy-fit. But the latter is usually intermittent.

Thanks for the info Shane. Since I have a functional copy to test with I’ll take another crack at determining the trigger if not the cause. I have managed to make AppleScript angry a few times recently, requiring a restart before proper behavior was restored.

Depending on version of OSX. There are security limitations to allow access to script libraries. (Anything in the Library folder)
SB has access, your stand alone app doesn’t

Check to make sure SB is embedding your libraries inside of the app itself

@Shane_Stanley I’m facing the same error. Is there any threading releated to loading libraries in AppleScript + Dialog Toolkit Plus?

	local scriptName
	set scriptName to "fx-review-documents-rules"
	
	local scriptPath
	set scriptPath to (system attribute "HOME") & globalLibrariesPath & scriptName & ".scpt"
	
	local scriptHandler
	set scriptHandler to load script (POSIX file scriptPath as alias)

I use the toolkit with DEVONthink and run it from the external scripts menu on MacOS. The full description can be found here:
https://discourse.devontechnologies.com/t/using-dialog-toolkit-plus-with-dt-results-in-nsthread-doesn-t-understand-the-ismainthread-message/85862

I don’t think it’s a threading issue. As far as I’m aware, it’s as I said above:

Not sure, if this really helps others, but anyway:

For some reason it see the error more often, if I store large portions of data in global variables - like scripts with load script.

In one of my scripts using Dialog Toolkit, I stored a larger dictionary in a global variable. After adding another entry, the script constantly fails. After removing it, it succeeded again.

For my use case, I got rid of that error (for now) by moving away from properties holding “large” amount of data.

Failing abbreviated example

	property globalpresets : {¬
		{presetTitle:"Global: No preset", addYearlyLocation:true, basePath:"", databaseName:"", addTags:{}, companyName:"", taxYear:""}, ¬
		{presetTitle:"Global: No rule", addYearlyLocation:false, basePath:"/_Review/.NORULE", databaseName:"Inbox", addTags:{}, companyName:"", taxYear:""}}