(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 51809, 1219] NotebookOptionsPosition[ 14882, 408] NotebookOutlinePosition[ 49594, 1168] CellTagsIndexPosition[ 48497, 1147] WindowTitle->Automatic WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell["\<\ This Mathematica notebook, \[Copyright] Copyright 2009 Scientific Arts, LLC, \ all rights reserved.\ \>", "Title", Editable->False, Deletable->False, CellFrame->{{0, 0}, {1, 1}}, CellDingbat->None, ShowCellBracket->False, CellMargins->{{0, 0}, {10, 10}}, CellFrameMargins->10, TextAlignment->Center, FontFamily->"Helvetica", FontSize->12, FontWeight->"Plain", FontColor->GrayLevel[0.3], Background->GrayLevel[0.9], CellTags->"CoyyrightCell"], Cell["Security Tools", "Subsection", Editable->True, Deletable->True, CellDingbat->None, CellBracketOptions->{"Color"->RGBColor[0.7, 0, 0], "Thickness"->2}, Copyable->True, CellOpen->True, TaggingRules:>"GUIDTag[289039563243853257102389514323558837090]", Background->RGBColor[ 0.9012345679012346, 0.9012345679012346, 0.9012345679012346], CellTags->{ "EssayCell", "Subsection284679318267757849172850723292113040025", "EssayBodyCell284679318267757849172850723292113040025", "EssayCell284679318267757849172850723292113040025", "DiaryDate[{2008, 3, 2, 19, 53, 27.278242}]", "CellGUID[101092174127946203893209486792098704430]", "GUIDTag[284679318267757849172850723292113040025]", "BlogEntryTitle284679318267757849172850723292113040025"}, CellID->2031583469], Cell[TextData[{ "Posted on: Sunday, March 2, 2008 at 08:01 PM UT", " ", ButtonBox["Notebook Version", BaseStyle->"Hyperlink", ButtonData:>{ URL["BE3413476880/BE3413476880.nb"], None}] }], "Subsubsection", FontFamily->"Helvetica", FontSize->11, FontWeight->"Bold", Background->GrayLevel[0.98]], Cell[TextData[{ "When creating a general system in ", StyleBox["Mathematica", FontSlant->"Italic"], " like ", StyleBox["A", FontWeight->"Bold", FontColor->RGBColor[0.542718, 0.103822, 0.139086]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0.647059, 0.119585, 0.134844]], StyleBox["Life", FontWeight->"Bold", FontColor->RGBColor[0.692302, 0.471, 0.275517]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Frame", FontWeight->"Bold", FontColor->RGBColor[0.0872663, 0.520363, 0.287388]], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0, 0.300008, 0.4]], " (", ButtonBox["http://scientificarts.com/worklife", BaseStyle->"Hyperlink", ButtonData->{ URL["http://scientificarts.com/worklife"], None}], ") I often need to process multiple notebooks to gather data from those \ notebooks to distill and present to the user. Often I open these notebooks \ with the option Visible\[Rule]False so that the user doesn't see them opening \ and closing as the processing takes place. But if those notebooks have \ dynamic content in them then, each time they are opened (even if invisible), \ a dialog will open asking if the user gives permission for dynamic content to \ be evaluated. This is a very good feature--it is key to security in a system \ that allows automatic evaluation of dynamic content that can access the \ operating system. ", StyleBox["Mathematica", FontSlant->"Italic"], " allows you to mark a directory as \"Trusted\" and, if so marked, opening \ notebooks from a trusted directory will not prompt the permission dialog.\n\n\ The interface in ", StyleBox["Mathematica", FontSlant->"Italic"], " for adding a new directory to the list of trusted directories is not very \ user friendly at the moment (it involves knowing how to edit \ FrontEnd`FileName expressions) and so I have created a function that does \ this in a way that is more intuitive in that it simply prompts you to select \ a directory from the standard file system Open dialog. \n\nIn fact, in ", StyleBox["A", FontWeight->"Bold", FontColor->RGBColor[0.542718, 0.103822, 0.139086]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0.647059, 0.119585, 0.134844]], StyleBox["Life", FontWeight->"Bold", FontColor->RGBColor[0.692302, 0.471, 0.275517]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Frame", FontWeight->"Bold", FontColor->RGBColor[0.0872663, 0.520363, 0.287388]], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0, 0.300008, 0.4]], ", there are a very large number of features that make underlying \ functionality of ", StyleBox["Mathematica", FontSlant->"Italic"], " much more useful; hence the tagline for the product: \"Extending ", StyleBox["Mathematica", FontSlant->"Italic"], "'s Reach...\" You can download the fully functional trial version of ", StyleBox["A", FontWeight->"Bold", FontColor->RGBColor[0.542718, 0.103822, 0.139086]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0.647059, 0.119585, 0.134844]], StyleBox["Life", FontWeight->"Bold", FontColor->RGBColor[0.692302, 0.471, 0.275517]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Frame", FontWeight->"Bold", FontColor->RGBColor[0.0872663, 0.520363, 0.287388]], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0, 0.300008, 0.4]], " from ", ButtonBox["http://scientificarts.com/worklife/trial.html", BaseStyle->"Hyperlink", ButtonData->{ URL["http://scientificarts.com/worklife/trial.html"], None}], "\n\nHere is the code that defines a function AddTrustedPath that presents \ the more useful interface to taking this action (note that, as it should, it \ still opens a dialog at the end that will ask for confirmation that you do \ indeed want to add the directory that you choose). A set of functions like \ this (also ones for adding un-trusted paths, for example) are currently in \ the Development version of ", StyleBox["A", FontWeight->"Bold", FontColor->RGBColor[0.542718, 0.103822, 0.139086]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0.647059, 0.119585, 0.134844]], StyleBox["Life", FontWeight->"Bold", FontColor->RGBColor[0.692302, 0.471, 0.275517]], StyleBox[" ", FontWeight->"Bold"], StyleBox["Frame", FontWeight->"Bold", FontColor->RGBColor[0.0872663, 0.520363, 0.287388]], StyleBox["Work", FontWeight->"Bold", FontColor->RGBColor[0, 0.300008, 0.4]], ":" }], "Text", Editable->True, Deletable->True, CellBracketOptions->{"Color"->RGBColor[0.7, 0, 0], "Thickness"->2}, Copyable->True, CellOpen->True, TaggingRules:>"GUIDTag[261054326736877838414386808080066454062]", CellChangeTimes->{{3.413476427340415*^9, 3.4134765155453653`*^9}, 3.413476814591051*^9}, CellTags->{ "EssayCell", "Text284679318267757849172850723292113040025", "EssayBodyCell284679318267757849172850723292113040025", "EssayCell284679318267757849172850723292113040025", "DiaryDate[{2008, 3, 2, 19, 53, 27.577406}]", "CellGUID[16058599087523679242532299053642512168]", "GUIDTag[284679318267757849172850723292113040025]"}, CellID->1980859830], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"AddTrustedPath", "::", "\"\\""}], "=", "\"\\""}], ";"}]], "Input", Editable->True, Deletable->True, CellBracketOptions->{"Color"->RGBColor[0.7, 0, 0], "Thickness"->2}, Copyable->True, CellOpen->True, TaggingRules:>"GUIDTag[283307745073012493277745364063702632070]", CellChangeTimes->{ 3.413476527343252*^9, {3.41347694625947*^9, 3.413476962446828*^9}}, CellTags->{ "EssayCell", "Input284679318267757849172850723292113040025", "EssayBodyCell284679318267757849172850723292113040025", "EssayCell284679318267757849172850723292113040025", "DiaryDate[{2008, 3, 2, 19, 55, 26.147202}]", "CellGUID[304902906830027138741363212951623957643]", "GUIDTag[284679318267757849172850723292113040025]"}, CellID->1303091728], Cell[BoxData[ RowBox[{ RowBox[{"AddTrustedPath", "[", "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Catch", "@", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "securityOptions", ",", "dir", ",", "trustedPaths", ",", "unTrustedPaths", ",", "unTrustedPathsAsStrings", ",", "trustByDefault"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"trustedPaths", "=", RowBox[{"CurrentValue", "[", RowBox[{"$FrontEnd", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\""}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"unTrustedPaths", "=", RowBox[{"CurrentValue", "[", RowBox[{"$FrontEnd", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\""}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"unTrustedPathsAsStrings", "=", RowBox[{ RowBox[{ RowBox[{"ToFileName", "[", RowBox[{"{", "#", "}"}], "]"}], "&"}], "/@", "unTrustedPaths"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"trustByDefault", "=", RowBox[{"CurrentValue", "[", RowBox[{"$FrontEnd", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\""}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"dir", "=", RowBox[{"SystemDialogInput", "[", RowBox[{ StyleBox["\"\\"", ShowStringCharacters->True], ",", "$HomeDirectory", ",", RowBox[{ "WindowTitle", "\[Rule]", "\"\