[WS] iTunes

Hello everybody!

Is it possible for the script to read tag Artist - Music and search for the albums that have this song at iTunes Store? Basically what I do today is to type in the browser "Artist - Music itunes" and get the result it gives me (whether single or full album).

Can we optimize this with the script?

Have a nice day!
See ya!

Thanks! This script is great.

A little problem: i can't get tags for this album, i don't know why:

https://itunes.apple.com/us/album/homenaje-...eat/id422664406

I'm using the US script.

I was wondering if there's an easy way to modify the script to grab only the year. I don't like the whole release date, just the year. I'm just getting started, don't know much about editing src's.
Thanks!

Then let the script get all of the data and run an action afterwards to tailor the data according to your needs.

How do i make that action?

see the FAQs on how to create an action /t/967/1

In which field do you find the long date and in which field do you want to save it?

I read the faqs but still don't get it. I understand how to create actions. But i don't know how to do this one. I think i should choose the action type "replace". In "field" i should enter "year". But what should i enter in "original"? And what should i enter in "replace with"? I mean, each date is different for each album.

Answering to your question, i find the long date in the field "year". I want to save in the field "year" only the year of the release, i don't care about the long date. Here's an example:

After hitting ok, i get this:

I would like it to say only "2015" in the "year" field, in this particular case.

OK.
Try an action of the type "Format value" for YEAR
Format string: $left(%year%,4)

It works great! Thanks!

This may or may not apply to you. Just a FYI for anyone else who simply wants the four-digit year. Use the following in place of the "# YEAR" section (modified from Stevehero's src):

# YEAR
    outputto "YEAR"
    regexpreplace "(\d{4}-\d{2}-\d{2})" "<<<$1>>>"
    sayregexp "(?<=\"releaseDate\":\"<<<).+?(?=-\d{2}-\d{2}>>>)" ", " "}"

Hello,
Thank you for the great script! :w00t:

Is it possible to integrate, that "TRACK" lists the TRACKNUMBER and the TOTALTRACKS like "2/14"?

I tried this for disc numbers (see below) and it worked, but when I implement the same part for "TRACK" it overwrites the title of the song.

Any guess on what I could do?
Thank you! :slight_smile:

outputto "DISCNUMBER"
FindLine "\"discNumber\":"
FindInLine "\"discNumber\":"
SayUntil ", \""
Say "/"
FindLine "\"discCount\":"
FindInLine "\"discCount\":"
SayUntil ", \""
Say "|"
outputto "TRACK"
FindLine "\"trackNumber\":"
FindInLine "\"trackNumber\":"
SayUntil ", \""
Say "/"
FindLine "\"trackCount\":"
FindInLine "\"trackCount\":"
SayUntil ", \""
Say "|"

curious if someone could help me with this, I want [Search By] to remove additional tags often found in the %title%

so far this is what I have

[SearchBy]=%title%
    replace " (Clean)" ""
    replace " (Clean) (Extended)" ""
    replace " (Instrumental)" ""

I do not know how to make the replace action act on %title% so that the search will prompt the title without the aditional (Clean) (Extended) tags for example. Thanks!

QUOTE (yourdadsmusic @ Jun 13 2017, 23:26) <{POST_SNAPBACK}>
curious if someone could help me with this, I want [Search By] to remove additional tags often found in the %title%

so far this is what I have

[SearchBy]=%title%
    replace " (Clean)" ""
    replace " (Clean) (Extended)" ""
    replace " (Instrumental)" ""

I do not know how to make the replace action act on %title% so that the search will prompt the title without the aditional (Clean) (Extended) tags for example. Thanks!

Try this:

[SearchBy]=$regexp($replace($replace($replace(%title%,'(Clean)',),'(Extended)',),'(Instrumental)',),'(^.*[^ ])(.*$)',$1)

Basically, $replace removes those "additional tags" and $regexp eliminates the trailing spaces.

Thanks! this works perfectly! for anyone having trouble with this, if you want to add another word to remove from the query you have to add another ($replace to the line. so if you are removing 10 words, you should have 10 instances of ($replace also.

My final search query looks like this, you can see that i added "feat." and "&" to be filtered out of the artist section also
[SearchBy]=$regexp($replace($replace(%artist%,' feat.',),' &',),'(^.[^ ])(.$)',$1) $regexp($replace($replace($replace($replace($replace(%title%,'(Clean)',),'(Dirty)',),'(Extended)',),'(Radio Edit)',),'(Short Edit)',),'(Instrumental)',),'(^.[^ ])(.$)',$1)

To minimize the complexity of the formatstring, ...
see "Mp3tag/help/main_scripting.html" ...
the function $replace allows to add "from-to-pairs" within the function parameter list, ...
$replace(string,from1,to1,from2,to2,...)

DD.20170616.1818.CEST

oh awesome Ill try that out thanks! If anyone could help me with this last adjustment it would be awesome. I'm trying to get publisher field to only display record label info, no date or distributor. In trying to get rid of the date i figured the following would work:

outputto "PUBLISHER"
FindLine "\"copyright\":\""
FindInLine "\"copyright\":\""
SayUntil "\", \""
regexpreplace "℗ (\d{4})" ""

but it seems unable to grab the date, should I be putting this under # COPYRIGHT instead? i think my best option would be to use $cutLeft and specify 7 spaces to be removed, but i havent been able to properly integrate it

as for the following distributor info, I would like to make a rule that anything starting with and following a "/" or " ," would be removed.

An example of my ideal Publisher field; ℗ 2017 Kemosabe Records/Columbia Records, a Division of Sony Music Entertainment

would turn into Kemosabe Records

sorry for the ignorance! I really appreciate the help

Try this (just some of my modifications to the script I use personally):

# PUBLISHER
    outputto "PUBLISHER"
    regexpreplace "\,\s[Uu]nder\s[Ee]xclusive\s[Ll]icense.*?(\",)" "$1"
    regexpreplace "(?:(?<=\"copyright\":\")(?:[^A-Za-z0-9]\s)?\d{4}\s([^/]*).*?(\",))" "$1$2"
    sayregexp "(?<=\"copyright\":\").+?(?=\")" ", " "}"
QUOTE (ms6676749 @ Jun 18 2017, 02:45) <{POST_SNAPBACK}>
Try this (just some of my modifications to the script I use personally):
# PUBLISHER
    outputto "PUBLISHER"
    regexpreplace "\,\s[Uu]nder\s[Ee]xclusive\s[Ll]icense.*?(\",)" "$1"
    regexpreplace "(?:(?<=\"copyright\":\")(?:[^A-Za-z0-9]\s)?\d{4}\s([^/]*).*?(\",))" "$1$2"
    sayregexp "(?<=\"copyright\":\").+?(?=\")" ", " "}"<!--QuoteEnd--></div><!--QuoteEEnd-->

Thanks so much again, its working perfectly. learning from what you gave me I added a line to remove ", a division of" clauses that come up alone sometimes; example- Epic Records, A Division of Sony.... you can see how i added below. It's amazing how helpful you guys are on this forum

outputto "PUBLISHER"
regexpreplace "\,\s[Uu]nder\s[Ee]xclusive\s[Ll]icense.*?(\",)" "$1"
regexpreplace "\,\s[Aa]\s[Dd]ivision.*?(\",)" "$1"
regexpreplace "(?:frowning:?<=\"copyright\":\")(?:[^A-Za-z0-9]\s)?\d{4}\s([^/]*).*?(\",))" "$1$2"
sayregexp "(?<=\"copyright\":\").+?(?=\")" ", " "}"

I am curious about the indentation of some lines though, is this just for organization or does mp3tag actually read the indented lines differently? my script seems to be working fine without the indentation

has anyone changed this window to automatically prompt "No" instead of "Yes" to increase workflow speed? I've tried to find this window in Resource Hacker but haven't been able to

If you press Alt-N on the keyboard (or perhaps even only "N") you can close the window almost as easy as pressing enter.

Also, there are some options in Tools>Option>Messages where you can tune which messages you want to see.