Crash on Python script execution

Hey,

I have a python script that should print out all files after the folder has changed.
The output appers in the script-protocol, but DOpus crashes :frowning:

Screenshot and script attached.

(Python.org 2.7 & 3.4, Win 7 64bit, DOpus 11.5.3)

Any ideas?


Script:

def OnAfterFolderChange(data): for x in data.tab.files: DOpus.output(x.name)

Is a crash dump created?

Sure; could you give me a mail-address?

Thanks! - leo@gpsoft.com.au

thx, sent...

Not much to go on, except that the crash is happening inside pythoncom34.dll and not Opus itself.

Thanks for the info

Hmm, crazy.

The following works:

def OnAfterFolderChange(data): counter = 0 while counter <= data.tab.files.count: DOpus.output(data.tab.files(counter).name) counter = counter + 1

but this one neither do:

def OnAfterFolderChange(data): for x in data.tab.files: DOpus.output(x.name)

Anyone any idea?

One idea is to use JScript instead :slight_smile:

Thanks jon :wink:

But you will understand, that everyone wants to use his preferred language :slight_smile:
And Python is one of the most popular languages.
Therefore it should work in one of the most popular file managers - imho.
Wether if the developers uses it themselves or not...

Python is popular in the wider world but not in an ActiveScripting/Automation context, so there will be issues with it which few people in the world, let alone here, know how to solve.

You can use whatever you want, but using something other than JScript and VBScript for Opus scripting will make things more difficult*, probably more so than is offset by familiarity with another language. JScript and VBScript are very easy to pick up for anyone that already knows another scripting language.

(*In general. If you're doing something where a particular language has a big library for working on it which the other languages don't have, then it might be worth the pain.)

Regarding your problem, maybe python is a irritated by some variable/method/object types the DO scripting environment offers.

I at least, keep wondering what these are, supernatural maybe o): Persistent variable problem

This would be the same as this problem already reported: Crash on iterating collection (python)

I think I know what is causing it now, please try in the next update to see if it's fixed.

I'll wait for the next update.
Thanks in advance, jon.

It works with the current beta. Thanks a lot