It doesn't actually write to a file, I couldn't figure out how to work that in.. perhaps someone else can write it in.

Instead, it just saves it to your variables tab in the script editor (last tab on the right).