parameters from command line for assetbundle

hi, all
is there any idea to get the parameter passed from the command line itself.
In my case :

/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -projpath ~/sample dyn/assets/editor -executeMethod autoexport.ExportResource

the above mentioned command line argument works well when i just put the static path in autoexport.js with having the ExportResource function that is made to be run. in this way its fine.
like this
ExportResource()
{
the code here;
}


But when i use

ExportResource(arg1,arg2)
{
the code here;
}

and i keep this in command line

/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -projpath ~/sample dyn/assets/editor -executeMethod autoexport.ExportResource /Assets/Mnfiles/product2.fbx product2.unity3d

than the files are not made as the way its made per the first criteria in a proper manner.

AND THE ERROR I GET IN LOG CONSOLE MESSAGES

NSDocumentController Info.plist warning: The values of CFBundleTypeRole entries must be ‘Editor’, ‘Viewer’, ‘None’, or ‘Shell’.

What can be done to get the parameter thing work.

Thanks

As far as I’m aware, you can not pass in any parameters from command line.

I would provide them through a plain text file that stores all those command tuples in distinct lines through which the script then would iterate.
You can even expand them to tripplets (command, source, target) should you need that because you do other things through command line too in the build.
That is by the way also more flexible as you can create a small standalone app to generate the “build request text file” I mentioned above.

Thanks dreamora,
i tried getting parameter directly pass through the command line, but didn’t work. I think you are right.

But can you elaborate it in examplified manner

as to how the argument could be passed in the manner i am working in this

ExportResource(arg1,arg2)
{
the code here;
}

there is no way to do that.

You tell unity which script to start and the script then has to fetch the parameters from some source, my suggestion is a file where you list all the jobs it has to do and write the script in a looping way so it goes through all jobs in one go (-> batch processing of the jobs and the text file beeing a list of batch operations)

Thanks dreamora
for letting me know the right track, actually i was trying somehow or than, but with your responsed i can get focused now,

Just one more thing is it possible to get data from .RTF file (as i am on MAC now) from the main JS file in which the function is made. Or i should try it out with the another JS file itself instead of .RTF

Thanks a lot

I would use a plain text file

RTF have formating data in that can bite your ass if you forget about it :wink:

That was actually the idea as well, using a plain text file instead of “hardcoding” the stuff.

so, if i make a plain text file and putting this in that file like :

lPath = “Assets/Mnfiles/product2.fbx”;
lFile = “product2.unity3d”;

than how can i load or call this in the main js, i think i will have to make this work under the function.
But how the code for that will be written.

Thanks !