# Do group actions tag as they go, or only at the end?

**URL:** https://community.mp3tag.de/t/do-group-actions-tag-as-they-go-or-only-at-the-end/58611
**Category:** General Discussion
**Created:** [September 28, 2022, 3:49pm UTC](https://community.mp3tag.de/t/do-group-actions-tag-as-they-go-or-only-at-the-end/58611 "2022-09-28T15:49:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ehead](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/5e9695/32.png) [@ehead](https://community.mp3tag.de/u/ehead)
#### Post date: [September 28, 2022, 3:49pm UTC](https://community.mp3tag.de/t/do-group-actions-tag-as-they-go-or-only-at-the-end/58611/1 "2022-09-28T15:49:05Z")

</div>

I have an action that is rather long and involved, with several replace, regex's, format values, etc... on a few different tags. When I apply this on m4b files it really takes a long time.

Was just wondering if each action triggers a tag write operation. For instance...  
Format value "FOLDER\_NAME": %album%  
Regular expression "FOLDER\_NAME" regex1  
Regular expression "FOLDER\_NAME" regex2  
Format value "FOLDER\_NAME": %FOLDER\_NAME% - %artist%

Will this cause folder\_name to get written to the file over and over again? Or, does mp3tag proceed to the end, figure out what the ultimate value of FOLDER\_NAME is going to be, then write it only once?

If it's writing over and over again that would account for why it's taking so long. I suppose I could try and consolidate/combine as many sub-actions as possible.

As you can see I'm sort of breaking this down procedurally. What I'd really like it to have a scratch variable to write to, then apply it as a tag at the end.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [September 28, 2022, 3:58pm UTC](https://community.mp3tag.de/t/do-group-actions-tag-as-they-go-or-only-at-the-end/58611/2 "2022-09-28T15:58:14Z")

</div>

There is no variable called

> [@ehead](#):
>
> FOLDER\_NAME

of if you use it, then it is a user-defined one.  
Which would also mean that the file itself has to be touched each time as the variable is sought in the tag data.  
And then it could be that the tag data has to be re-written as the padding is not big enought.

If you really refer to the variable %\_directory% which references the current folder name then this is a call of OS functions which really only manipulates the folder name - and that should be done fairly quickly.

Also, see here:

> [@Format Directory than Format Filename](https://community.mp3tag.de/t/format-directory-than-format-filename/19633):
>
> Using format directory to move files to new location, than trying to create Disc Folders using format filename in the newly created directory location however: Format Directory - moves folder to new location Format Filename - generates Disc folders but pulls files back to original location to do so? Why is that and how can I achieve my end result without having to pull the new directory folder into MP3tag and than run the format filename?
