These scripts are all cross platform JavaScript:

CS2, CS3, CS4…

If a script doesn’t work, open it in Notepad or TextEdit. It should start “#target bridge” for CS2, “#target bridge-2.0” for CS3, and “#target bridge-3.0″ for CS4”.
Also look for “app.version[0]” which should be 2 for CS3, 3 for CS4 etc.