Sourcing Mel Scripts And Script Jobs From Python

Sourcing mel scripts and script jobs from python

I am having serious STOP with this stuff now can't complete my script

Not pymel or maya default can create scriptJobs for some reason.If it works don't blaim me because there was a thread for weeks with that topic

anyways,as a workaround i tried to put the scriptJob creation in a mel script of one line.

like this :

scriptJob -ct "SomethingSelected" scriptJob_Some

global proc scriptJob_Some()
{
python("PythonProcedure()");
}

PythonProcedure() is a procedure perfectly working from python and from mel or like this from global proc in mel.

The problem comes when i source,i get errors.Any ideas what is the problem? I source other mel scripts too from python and that works ok.So again it might be the scriptJob creation problem?

Thanks and please help ,deadlines are coming

The answer wouldn't be something simple like...

you need to define your procedure before you use it in your scriptJob

would it?

(try putting the scriptJob after the global proc)