I am trying to export mobilograms of specific massess using the VBscripting of the software, and not by manually exporting each individual mobilogram. Is it possible?

0 votes
asked by about Bruker Compass DataAnalysis

I am trying to export mobilograms of specific massess using the VBscripting of the software, and not by manually exporting each individual mobilogram. Is it possible? Hereby the script I have so far, but I get an error for exporting the mobilogram

Dim TIC
Dim EIC
Dim Mobilograms
Dim EIM
Dim ExportPath

Set TIC = CreateObject("DataAnalysis.TICChromatogramDefinition")
Set EIC1 = CreateObject("DataAnalysis.EICChromatogramDefinition")
Set EIC2 = CreateObject("DataAnalysis.EICChromatogramDefinition")
Set EIM1 = CreateObject("DataAnalysis.EIMMobilogramDefinition")
Set EIM2 = CreateObject("DataAnalysis.EIMMobilogramDefinition")

EIC1.Range = "808.8-809.8"
EIC2.Range = "1516.4-1616.8"
EIM1.TimeRange = "0-0.5"
EIM1.Range = "808.5-809.5" EIM2.TimeRange = "0-0.5"
EIM2.Range = "1516.5-1616.5"

Analysis.Compounds.Clear Analysis.Chromatograms(1).ClearRangeSelections

Analysis.Chromatograms.AddChromatogram TIC Analysis.Chromatograms.AddChromatogram EIC1 Analysis.Chromatograms.AddChromatogram EIC2

Analysis.Chromatograms(1).AddRangeSelection 0, 0.5
Analysis.Chromatograms(1).AverageMassSpectrum false, true

Analysis.Mobilograms.AddMobilogram EIM1 Analysis.Mobilograms.AddMobilogram EIM2

ExportPath= "D:\Data\test" & Analysis.Spectra(1).name & ".XY" Analysis.Spectra(1). Export ExportPath, daXY ExportPath= "D:\Data\test" & Analysis.Mobilogram(1).name & ".XY" Analysis.Mobilogram(1). Export ExportPath, daXY

Analysis.save

form.close

1 Answer

0 votes
answered by (101k points)

To help with your question about exporting mobilograms using VBScript in Bruker Compass DataAnalysis, here's a general approach you can take:

  1. Verify Object Creation: Ensure that the objects are being created correctly with the right syntax. The %26quot; characters you've used should be \" in actual VBScript syntax to denote string literals.

  2. Export Functionality: You should check if the DataAnalysis object model offers a method for exporting mobilograms directly through scripting. It would typically involve an export method or function.

  3. Consult Documentation: Refer to the Bruker Compass DataAnalysis software documentation for available methods related to exporting data. The scripting API documentation would detail the correct methods and properties you can use.

  4. Testing and Debugging: Incorporate error handling and debug the script by printing out or logging details of the objects and operations to ensure everything is set correctly before the export operation.

  5. Example Adaptation: Here's a structured example based on the VBScript for exporting:

    Dim dataAnalysis
    Set dataAnalysis = CreateObject("DatAnalysis.Application")
    
    Dim EIC1, EIC2, EIM1, EIM2
    Set EIC1 = dataAnalysis.CreateObject("DatAnalysis.Chromatograms")
    Set EIC2 = dataAnalysis.CreateObject("DatAnalysis.Chromatograms")
    Set EIM1 = dataAnalysis.CreateObject("DatAnalysis.Chromatograms")
    Set EIM2 = dataAnalysis.CreateObject("DatAnalysis.Chromatograms")
    
    EIC1.Range = "808.8-809.8"
    EIC2.Range = "1516.4-1616.8"
    EIM1.TimeRange = "0-0.5"
    EIM1.Range = "808.5-809.5"
    EIM2.TimeRange = "0-0.5"
    EIM2.Range = "1516.5-1616.5"
    
    ' Example of export function (replace with actual method if exists)
    Dim exportPath
    exportPath = "C:\Path\To\Export\"
    EIM1.Export(exportPath & "Mobilogram1.txt")
    EIM2.Export(exportPath & "Mobilogram2.txt")

Ensure that the methods such as .Export() exist in the given application object model and modify the file paths and ranges as required. If the object model doesn't provide direct support for exporting mobilograms, you may need to consider alternate strategies like automating UI actions or contacting Bruker support for advanced scripting help.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register
...