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


and I need to switch any/all instances to


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.



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,

 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).

| improve this answer | |
  • $\begingroup$ 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! $\endgroup$ – user7040 Apr 21 '13 at 22:04
  • $\begingroup$ @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. $\endgroup$ – acl Apr 21 '13 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.