SRC and INC Files

My knowledge regarding the development of web source scripts is extremely rudimentary and just enough to understand a few lines of existing scripts and to change them to my liking.

The use of INC files, which has been possible for some time, is very practical in order to use general code for different calls through SRC files.

However, at the moment I have the problem that I have to make my own changes to SRC files, including the Apple Websource Scripts, which consist of umpteen SRC files to take individual countries into account.
I would like to extend "SearchBy" with a replace function for %albumartist%: $replace(%ALBUMARTIST%,'Various Artists',), which indeed works in the SRC file.
Based on the Apple script, it looks like this in my SRC file:

[SearchBy]=Search for||[$if2(%ITUNESALBUMID%,[$if2([$if2($replace(%ALBUMARTIST%,'Various Artists',),%ARTIST%)][ %ALBUM%],[%_directory%] [%_parent_directory%])])]||&term=%s

Unfortunately, this means that I have to make this change in umpteen SRC files and again with every updated version.
So my question:
Is it possible to move this $replace function to the INC file so that I only have to make the change once for every web source?

I just made a small test and it seems that you can place your
in the INC file too (not additional, just "instead of")

So the source file would only include one line:
[Include]=Name of your include

What if you try it with one of your examples?

1 Like

Thanks. It works and I didn't think it would be that easy.

1 Like