In a game I'm in, we have a script written in an unknown language. We can use comprehend languages to read it. However, is there a method to learn the name of the language itself?
I am unable to find specific rules for determining the language in use, which rather makes sense: the exact DCs probably should depend on a host of factors, including the age of the artifact, how much text is present, how common the language is (or was), etc.. Which means, this is largely going to come down to being a question of how hard the GM wants it to be.
However, there are a few options that stand out as being helpful or just good starting points:
Depending on the item in question, Legend Lore may be useful. It's fairly expensive and limited by requiring the item about which you want to learn being "legendary" (with only vague guidelines as to what that means). It's also a pretty high level spell.
Knowledge (probably History) would likely be helpful in determining the history of the place in which the script was found, which may lead to identifying the creatures that lived there and their native language.
The third-party Pathfinder spell Speak with Objects may be useful, if your GM allows it; like Knowledge (History), its primary benefit would likely be learning the name of the race that created the artifact.
Decipher Script should also be helpful. Speak Language skill has a list of common languages and their alphabets; knowing the alphabet used would point towards languages that use it. Further, Decipher Script (as described) should help point to a language family (the description doesn't say this literally, but the line about being "skilled at working with language" and being able to "decipher writing in an unfamiliar language ... or archaic form" strongly suggest having a working knowledge of language families.
Pathfinder's Downtime rules include options for Researching Facts and Lore. The rules require using Knowledge checks, which reinforces the use of Knowledge (History) above. It's a whole new subsystem in a different-but-related system, but it might help nudge a GM into making research easier.
Contact Other Plane or Commune would both be helpful in narrowing down the possibilities, or choosing between a couple of options once the pool has been shrunk sufficiently. Divination could be useful, but is more reliant on the GM's interpretation of the spell (it would also require a very carefully worded "plan"). At sufficient level, one of the Summon Monster spells could be used to summon a creature that might know which language a text is written in; again, this requires the GM to rule that the summoned creature knows the answer.
The 3rd party Sword and Sorcery book The Complete Book of Eldritch Might also has Object Loresight, a first level sorc/wiz spell which gives additional information with each casting; the 4th casting gives the race of the object's creator.
The Hypercognition psionic power can provide the information you are needing using inference from the language itself. The Destiny's Trail power (from the WotC official 3.5 Planescape book) could also provide the requisite information.
Once you have enough of the language translated, you may be able to infer the name of the language from hints (or Astral echoes) from the language itself.
In the case of Destiny's trail, you would have to cleverly pick your target event in order to figure out a scenario where the name of the language was a critical part of the event being viewed.
Hypercognition (From the SRD)
You make lightning-fast deductions based on only the slightest clue, pattern, or scrap of memory resident in your mind. You can make reasonable statements about a person, place, or object, seemingly from very little knowledge. However, your knowledge is in fact the result of a rigorously logical process that you force your mind to undertake, digging up and correlating every possible piece of knowledge bearing on the topic (possibly even extracting echoes of knowledge from the Astral Plane).
The nature of the knowledge you gain concerning the subject of your analysis might include the answer to a riddle, the way out of a maze, stray bits of information about a person, legends about a place or an object, or even a conclusion concerning a dilemma that your conscious mind is unable to arrive at.
An Intelligence check may be required to obtain the desired information. If so, you can manifest hypercognition as an immediate action prior to making the check and receive a +20 bonus for doing so.
Destiny's Trail (From the WotC official 3.5 Planescape book)
Members of the Transcendent Order have largely come to grips with the idea that they are but parts of a much greater tapestry that defines fate and reality. By examining individual threads and their relation to the big picture of a scene, you can determine the people that were involved in certain moments in time. You must have a specific event in mind, such as someone’s murder or the last time a particular portal was used, and must be at the location where it occurred. Upon using destiny’s trail you learn the names and faces of the people directly involved. In the case of the murder, this would include the victim and any attackers, witnesses that might have interfered, and so on. In the case of who used a portal last, you would learn of the last group to pass through the portal, the individuals who provided them the information to use it, anyone they were journeying to see, etc.
This power does not relay information about people that had no effect on the event, such as witnesses that did not interfere and were not seen, and it does not distinguish the motives or roles of those involved, meaning that you would have to investigate on your own to determine who was a witness and who was an assailant. It also does not inform you of who was involved in earlier events leading up to the specified moment, such as why the victim was heading to a particular pub, but subsequent uses of this power can be used to glean more such pertinent information.