[S8386] Script for exporting images to the same directory as the JPROJ file

 

The following is an example of a script that exports images to the same directory as the JPROJ file.

import os

app = designer.GetApplication()

# Get the folder path

Folder = os.path.dirname(app.GetProjectPath())

# Set the name of the image file

fileName = u"test.png"

# Create the save destination path

filePath = os.path.join(Folder, fileName)

# Get the study being displayed

app.SetCurrentStudy(0)

# Exporting image files

app.ExportImage(filePath)

How to use script file

Use the JMAG Script Library after reading and agreeing to the following terms of use.