# DO12 - Is it possible to combine a macro and a script?

**URL:** https://resource.dopus.com/t/do12-is-it-possible-to-combine-a-macro-and-a-script/22618
**Category:** Help & Support
**Created:** [May 24, 2016, 5:49am UTC](https://resource.dopus.com/t/do12-is-it-possible-to-combine-a-macro-and-a-script/22618 "2016-05-24T05:49:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [May 24, 2016, 5:49am UTC](https://resource.dopus.com/t/do12-is-it-possible-to-combine-a-macro-and-a-script/22618/1 "2016-05-24T05:49:19Z")

</div>

Say I wish to do the following action within Opus 12 rename dialog

1. rename a file using regular expressions
2. use an existing script (currently under a button in the toolbar)
3. rename the file back to the old name

example

1. from "File 01-2015.pdf" to "File 01-01-2015.pdf" (use regex here)
2. then apply existing script: change mod.date after date in filename
3. then rename the file back to "File 01-2015.pdf" (use regex here)

If at all possible, this should probably be saved as a macro?

# thanks

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [May 24, 2016, 10:36am UTC](https://resource.dopus.com/t/do12-is-it-possible-to-combine-a-macro-and-a-script/22618/2 "2016-05-24T10:36:34Z")

</div>

You could put the three commands into one button, yes.

But it may be better and just as easy to edit the script so it does what you want without having to rename the files back & forth.

---

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [May 24, 2016, 12:12pm UTC](https://resource.dopus.com/t/do12-is-it-possible-to-combine-a-macro-and-a-script/22618/3 "2016-05-24T12:12:39Z")

</div>

Many thanks.
