17-01-2017 12:01 AM - edited 17-01-2017 12:01 AM
Hi! Im starting to use the script editor en mega and i found out how to export objects using this code:
Set oBP=GetCollection("Software technology")
oBP.CallMethod("~Bav0cNnAjyQR[Standard for export]").SaveAs "C:\Desktop\MegaExport.xml","CommandFormat=XML"
and i have been searching and reading the import documentation but i dont understando how to import a file that contains objects to mega.
Is there a simple code like the one above for importing?
Thanks!
Solved! Go to Solution.
19-01-2017 10:17 AM
In the above example, MyDb is a MegaDatabase object that you can get in a Administration script from the collection MegaDatabases on a MegaEnvironmentObject
See for example KB http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=501D00000014PFaIAM
If you want to run the import from the script editor in a private workspace, the context is different because the repository is implicitely the current repository
In this situation:
Code example (VB script)
Set oRoot = GetRoot() oRoot.MegaImport "C:\tmp\import.mgr","C:\tmp\rejects_import.mgr"
18-01-2017 10:33 PM - edited 18-01-2017 10:56 PM
Thank You Jerome! i´ll give it a try!
I just have a doubt, how do you declare the mydb object?
Thanks!
17-01-2017 09:03 AM - edited 17-01-2017 09:04 AM
There is a function Import on a MegaDatabase object
MyDb.import "C:\temp\test_import.mgr","C:\temp\test_rejimport.mgr", "Meta=Off,Technical=Off,Data=Full"