# Importing actions from Windows

**URL:** <https://community.mp3tag.de/t/importing-actions-from-windows/58567>\
**Category:** Mac\
**Created:** [September 24, 2022, 2:43am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567 "2022-09-24T02:43:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![djdizzle](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@djdizzle](https://community.mp3tag.de/u/djdizzle)\
**Post date:** [September 24, 2022, 2:43am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/1 "2022-09-24T02:43:15Z")

</div>

Hi,

I have imported my actions files from Windows, and my Sort tag actions don't appear to be working. Are the actions formatted differently between macOS and Windows?

---

<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 24, 2022, 6:14am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/2 "2022-09-24T06:14:20Z")

</div>

> [@djdizzle](#):
>
> Are the actions formatted differently between macOS and Windows?

Hard to say. You would have to show us such an action, preferably as screendump.

---

<div class="post-metadata">

**Author:** ![djdizzle](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@djdizzle](https://community.mp3tag.de/u/djdizzle)\
**Post date:** [September 24, 2022, 6:19am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/3 "2022-09-24T06:19:12Z")

</div>

```auto
[#9]
T=5
1=%albumartist%
F=ALBUMARTISTSORT

[#10]
T=16
F=ALBUMARTISTSORT
1=,

[#11]
T=2
F=ALBUMARTISTSORT
1=\u00c0,\u00c1,\u00c2,\u00c3,\u00c4,\u00c5,\u00e0,\u00e1,\u00e2,\u00e3,\u00e4,\u00e5
2=A,a
3=0|0

[#12]
T=2
F=ALBUMARTISTSORT
1=\u00c6,\u00e6
2=AE,ae
3=0|0

[#13]
T=2
F=ALBUMARTISTSORT
1=\u00c7,\u00e7
2=C,c
3=0|0

[#14]
T=4
F=ALBUMARTISTSORT
1=^The (.+)
2=$1, The
3=0

[#15]
T=4
F=ALBUMARTISTSORT
1=^\\s+|\\s+$
2=
3=0

[#16]
T=4
F=ALBUMARTISTSORT
1=\\s{2,}
2= 
3=0

[#17]
T=2
F=ALBUMARTISTSORT
1=[ 
2=[
3=0|0

[#18]
T=2
F=ALBUMARTISTSORT
1= ]
2=]
3=0|0

[#19]
T=5
1=$regexp(%albumartistsort%,'\\sfeat.?\\s',';')
F=ALBUMARTISTSORT

[#20]
T=5
1=$regexp(%albumartistsort%,'\\svs.?\\s',';')
F=ALBUMARTISTSORT

[#21]
T=5
1=$regexp(%albumartistsort%,'\\swith?\\s',';')
F=ALBUMARTISTSORT

[#22]
T=5
1=$regexp(%albumartistsort%,'\\sand?\\s',';')
F=ALBUMARTISTSORT

[#23]
T=16
F=ALBUMARTISTSORT
1=;

[#24]
T=16
F=ALBUMARTISTSORT
1=&

[#25]
T=4
F=ALBUMARTISTSORT
1=^([^,[]+)\\s([^,[]+)$
2=$2, $1
3=0

[#26]
T=4
F=ALBUMARTISTSORT
1=^([^,[]+)\\s([^,[]+)\\s(\\[.+\\])$
2=$2 $3, $1
3=0

[#27]
T=1
F=ALBUMARTISTSORT
1=1
2=

[#28]
T=8
F=ALBUMARTISTSORT
1=; 

[#29]
T=2
F=ALBUMARTISTSORT
1=Artists, 
2=
3=0|0

```

---

<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 24, 2022, 6:23am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/4 "2022-09-24T06:23:51Z")

</div>

And which one does not work?  
(I am rather reluctant to research what this code could mean - that is why I asked for a screendump)

---

<div class="post-metadata">

**Author:** ![djdizzle](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@djdizzle](https://community.mp3tag.de/u/djdizzle)\
**Post date:** [September 24, 2022, 6:28am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/5 "2022-09-24T06:28:30Z")

</div>

#25 and #26, are the problem. They are supposed to swap `First Last` with `Last, First`.

---

<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 24, 2022, 6:37am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/6 "2022-09-24T06:37:01Z")

</div>

I tried both in Windows and they don't work there either.  
The result is in both cases the original string.

---

<div class="post-metadata">

**Author:** ![djdizzle](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@djdizzle](https://community.mp3tag.de/u/djdizzle)\
**Post date:** [September 24, 2022, 6:50am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/7 "2022-09-24T06:50:10Z")

</div>

That is odd. Unless macOS does something to the mta format or encoding.

---

<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 24, 2022, 7:05am UTC](https://community.mp3tag.de/t/importing-actions-from-windows/58567/8 "2022-09-24T07:05:08Z")

</div>

What i said was that the code that you supplied with that hard to read listing does not lead to the expected result of swapping words.

I would use 2 actions of the type "Format value" for the artistsort field:  
Format string: `$regexp(%artist%,'(.*) (.*) (.*)','$2, $3 $1')`  
and the next:  
Format string: `$regexp(%artist%,'(.*?) (.*)','$2, $1')`

Edit: why was it necessary to import the actions from Windows as you got a solution for the Mac already:

> [@AlbumArtistSort and ArtistSort - switch first and last names](https://community.mp3tag.de/t/albumartistsort-and-artistsort-switch-first-and-land-names/55992/14):
>
> I had a look at the expression used in #17 and it seems to me that an escape of the opening bracket in the first match group is missing. A correct expression would be ^([^,\[]+)\s([^,\[]+)$ The same applies to the expression using in #18 ^([^,\[]+)\s([^,\[]+)\s(\[.+\])$
