Starting version 2.40b[a].002 scripts run by default inside the DesktopX GUI
thread. This is because scripts mostly work interactively, affect the object
appearance, respond to user input etc. It make sense to do such things
synchronously with the DesktopX thread.
If you need some long running scripts to be asyncronous, you can enable the menu
option in the Script Editor “Run in separated thread”. For instance, if a script
isn’t elaborating (downloading from internet etc) for several seconds, it will
not lockup DesktopX until it returned.
There is only a caveat in running scripts in the secondary thread: scripts in
one thread cannot access the script namespace of a script in another thread. For
instance, you cannot use:
DesktopX.ScriptObject(“object1”).* if “object1” is in a different thread.
However, you can use the DesktopX.Object(“object1”).* shortcut as explained
before, because it doesn’t hook into the actual script namespace. Of course you
can only use Object properties and methods, not access script variables,
functions and other sub-namespaces.