It just doesn't work when editing .tex files (Pressing f7 or selecting build from the menu).Strangely enough, it works on non .tex-files. E.g. if i have opened a file 'test.txt' and I press f7, pdflatex gets called on it (and generates an error, obviously):

Naturally, this is not usable at all because I have to change it in the build script every time I edit another file. If build autodetect is on or off (I select LaTeX from the list manually then) doesn't matter.

For the build systems to work automagically, you need to set it to "Automatic" (Tools > Build System > Automatic) and then use the correct selector in the various individual build systems. As @arthuralvim pointed out, the scope for latex files is "text.tex.latex". So you need to change the selector in your build system for LaTeX to this scope.

You can find out what the scope is for a syntax by opening an appropriate file (e.g., *.tex), hitting Ctrl+Shift+Alt+P and looking in the status bar. You can also inspect the appropriate tmLanguage file. E.g., Packages > LaTeX > LaTeX.tmLanguage, all the way at the bottom of the file.

Thanks for the information on the scope, i've changed it to 'text.tex.latex' now and the build script gets called corretly. However, id doesn't do anything and prints out the following error on the sublime text console:

Traceback (most recent call last): File "./sublime_plugin.py", line 325, in run_ File "./exec.py", line 124, in runUnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 75: ordinal not in range(128)

This is a totally different error. The path of the .tex file im editing contains an 'ä' (Umlaut a, unicode 0xE4), and apparently sublime doesn't handle unicode args correctly when calling plugins/build scripts. So I guess this should be considered a bug?