How can I set notebook's options without opening it?

At present moment, to batch apply a change in a set of notebook I use a "brute force", rough, method:

(* simple example *)
setBackgroundBlue[notebookFileName_] := Module[
{tempNb},
tempNb = NotebookOpen[notebookFileName];
SetOptions[tempNb, Background -> Blue];
NotebookSave[tempNb];
NotebookClose[tempNb];
];
SetAttributes[setBackgroundBlue, Listable];


but I bet that there exists a smarter one. Please, can you provide any hint ? I have been brooding about text processing notebooks file, but it's prone to error, especially when dealing with complex structure in TaggingRules..

• I'm doing what you are doing. I was thinking about that for a long time and I'm afraid I don't have good news about alternative ways. Another approach could be to use NotebookGet, then it will be easier to deal with a Notebook expression than with pure text. Isn't really different from what you method does and is less handy. Additionaly, you may want to use this method to avoid prompting dynamics Create a notebook and save it without prompting Dynamics.
– Kuba
Apr 28 '16 at 8:10
• Thanks for your reply ! The reason why I'm trying to do that is a long tale and I'm going to post a specific question. By the way, for now, are you aware of any snippet manager particularly fitting Mathematica's code ? Apr 28 '16 at 11:52
• I'm not sure I got your question, could you clarify?
– Kuba
Apr 29 '16 at 8:58
• @Kuba There is a plenty of "free snippet manager" in Internet, and I will post a specific question about snippet manager for Mathematica's code, including an hypothetical "wish list". For the present moment I'm simply curious to learn from a seasoned programmer if he have any predilection among them. Apr 29 '16 at 20:59