# How to change Compiled->False to Method->{Compiled->False} in multiple notebooks?

I have a collection of about 40 notebooks where the options for ParametricPlot and ParametricPlot3D have:

Compiled->False


and I need to switch any/all instances to

Method->{Compiled->False}


Is there a way to do this via Mathematica v.9? One challenge is that I do not know all the notebooks which may or may not have this.

Perhaps Mathematica is not the proper tool and this is more of shell scripting exercise?

Any thoughts on the best way to approach this would be greatly appreciated.

Cheers,

t.

PS - Mac OS X, Mathematica v.9 (latest update)

-

I have no idea how robust this is, but if old.nb is the old notebook,

Export["~/Desktop/new.nb",
Import["/Users/acl/Desktop/old.nb"] /.
RowBox[{"Compiled", "\[Rule]", "False"}] :>
RowBox[{"Method", "\[Rule]",
RowBox[{"{", RowBox[{"Compiled", "\[Rule]", "False"}], "}"}]}]
]


does what you want and saves it to new.nb.

You can go through all notebooks by mapping this over Filenames[] (ask if you don't know how).

-
Thanks for the tip! I'll check the documentation on Filenames[] and I should be able to run with it from here. I wouldn't have noticed the "[Rule]" markup unless you pointed that out. Sometimes it's nice to just use emacs to view the notebooks and see what's actually written! –  user7040 Apr 21 at 22:04
@user7040 if you use emacs, why not just use that? do you know elisp? but this may be easier... The idea about FileNames is to do something like SetDirectory[NotebookDirectory[]];FileNames["*.nb"] to obtain a list of notebook files, then maybe assign the code I gave above to a function and map that. Ask here if you have problems. –  acl Apr 21 at 22:24