# Modifying a macro to create videos

**URL:** https://discourse.paraview.org/t/modifying-a-macro-to-create-videos/11154
**Category:** ParaView Support
**Created:** [January 12, 2023, 7:37am UTC](https://discourse.paraview.org/t/modifying-a-macro-to-create-videos/11154 "2023-01-12T07:37:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![RoLe](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@RoLe](https://discourse.paraview.org/u/RoLe)
#### Post date: [January 12, 2023, 7:37am UTC](https://discourse.paraview.org/t/modifying-a-macro-to-create-videos/11154/1 "2023-01-12T07:37:21Z")

</div>

Hi,

i have created a macro that has the function of loading the vtu and vtp files from a simulation that has been run, creating a video of the entire time period and then saving it.  
I now want to modify the macro so that I can apply it to multiple folders at once. I have used a for-loop to do this. Also, per folder the particle diameter is different, which I would solve through an if-condition. Unfortunately my modified macro does not work. I have not worked much with Paraview so I would appreciate if someone could answer me whether this would work in general and has tips for setting up the macro.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 12, 2023, 4:36pm UTC](https://discourse.paraview.org/t/modifying-a-macro-to-create-videos/11154/2 "2023-01-12T16:36:36Z")

</div>

Hi @RoLe

> Unfortunately my modified macro does not work.

Please share your macro

Best,

---

<div class="post-metadata">

### Author: ![RoLe](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@RoLe](https://discourse.paraview.org/u/RoLe)
#### Post date: [January 13, 2023, 7:07am UTC](https://discourse.paraview.org/t/modifying-a-macro-to-create-videos/11154/3 "2023-01-13T07:07:08Z")

</div>

Hi @mwestphal,  
thanks for the response. I have attached my macro.

[Animation.py](https://discourse.paraview.org/uploads/short-url/m8phFk8C0jF5M3M8jKluJZPEkuB.py) (13.8 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 13, 2023, 7:14am UTC](https://discourse.paraview.org/t/modifying-a-macro-to-create-videos/11154/4 "2023-01-13T07:14:08Z")

</div>

I’d suggest to rework your macro to avoid doing all the work in the loop.

Do it once, then change only what is needed in the loop.

- filename (based on folder)
- particle diameter
- then update the pipeline
