Background for Skyrim SE
Member of the DbMiscFunctions script
boolfunctionPrintStringKeysToFile(stringFilePathToSearch, stringFilePathToPrintTo, stringStartKey="", stringEndKey="", stringFinishedMsg="one Printing")Global

Description

Documentation Comment

PrintStringKeysToFile Finds and Prints all GetString / int / floatFromString StringKeys, from FilePathToSearch to FilePathToPrintTo
To speed up the process of making your StringKeys.txt file.
You can write GetStringFromFile() functions in your .psc file, and when you're finished with your script, have this function print the string keys to another .txt file.

Example, if in MyScript.psc you have:
Debug.Notification(GetStringFromFile("My Message A"))
Debug.Notification(GetStringFromFile("My Message B"))
Use the function:

PrintStringKeysToFile("Data/Scripts/Source/MyScript.psc", "Data/interface/MyStrings.txt")

In the MyStrings.txt file it will write:

"My Message A" = ["My Message A"]
"My Message B" = ["My Message B"]

note that the quotes are included. You'll want to get rid of them by pressing ctrl H in your text editor and replace all " with nothing so it looks like:

My Message A = [My Message A]
My Message B = [My Message B]

Otherwise the GetStringFromFile functions won't work correctly when reading from your .txt file.

Requires SKSE and PapyrusUtil


Parameters

  1. stringFilePathToSearch

  2. stringFilePathToPrintTo

  3. stringStartKey=""

  4. stringEndKey=""

  5. stringFinishedMsg="one Printing"


Examples

Auto-Generated Example

string myString__FilePathToSearch
string myString__FilePathToPrintTo
string myString__StartKey
string myString__EndKey
string myString__FinishedMsg

bool returnedValue = DbMiscFunctions.PrintStringKeysToFile(myString__FilePathToSearch, myString__FilePathToPrintTo, myString__StartKey, myString__EndKey, myString__FinishedMsg)
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.