# XML Plugin Help

**URL:** https://discourse.paraview.org/t/xml-plugin-help/933
**Category:** ParaView Support
**Created:** [November 19, 2018, 7:12pm UTC](https://discourse.paraview.org/t/xml-plugin-help/933 "2018-11-19T19:12:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aharvey](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@aharvey](https://discourse.paraview.org/u/aharvey)
#### Post date: [November 19, 2018, 7:12pm UTC](https://discourse.paraview.org/t/xml-plugin-help/933/1 "2018-11-19T19:12:56Z")

</div>

I have a python script I run in Paraview that opens a few files and applies a series of filters and takes some screen shots along the way. The script has a section for user variables too. Is it possible to create an XML only plugin in this case? My goal is to make it much easier for a user so they do not need to edit any of the python code and load it in. Ideally they would load some data files on their own, then apply this special filter which would prompt them to select the files they want to use and provide some parameters for the plugin itself.

I would prefer to make such a plugin without having to compile it because the users I’m supporting could be using any number of paraview versions and operating systems.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [November 20, 2018, 4:49am UTC](https://discourse.paraview.org/t/xml-plugin-help/933/2 "2018-11-20T04:49:18Z")

</div>

The closest thing I can think of is a ParaView macro. A macro is a Python script that can contain any of the Python commands available in the Python console. See the Macros menu for adding and managing macros.

Two things that aren’t possible, however, are providing a place to input parameters and choosing files in the UI. For those items, you could create a reader plugin (for file selection) and a Custom filter to chain together the series of filters and expose certain parameters, but this couldn’t include taking screenshots along the way. You could take screen shots in a macro, though.

---

<div class="post-metadata">

### Author: ![aharvey](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@aharvey](https://discourse.paraview.org/u/aharvey)
#### Post date: [November 20, 2018, 2:09pm UTC](https://discourse.paraview.org/t/xml-plugin-help/933/3 "2018-11-20T14:09:11Z")

</div>

Thanks for the feedback. Is there any reason why a macro couldn’t open a window for the user to enter in inputs? As for choosing input files, my intention was for the user to select them from the pipeline (i.e., files were already opened).

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [November 20, 2018, 2:30pm UTC](https://discourse.paraview.org/t/xml-plugin-help/933/4 "2018-11-20T14:30:50Z")

</div>

> [@aharvey](#):
>
> Is there any reason why a macro couldn’t open a window for the user to enter in inputs?

Macros are scripts that can be run in the ParaView desktop application that you are using, but they can also be run in `pvpython`, which assumes no UI is available. Hence ParaView does not provide a Python function to pop up a file choose from a Python script. Maybe you can find a way in Python to present a file chooser - I tried briefly with `tkInter.filedialog` available on my Mac, but it caused ParaView to crash.

> [@aharvey](#):
>
> my intention was for the user to select them from the pipeline

You can get one selected source from the pipeline with `paraview.simple.GetActiveSource()`. It is not currently possible to get more than one selected source in the pipeline.
