# Free-form input does not survive saving process in .wls files

Posted 16 days ago
181 Views
|
2 Replies
|
0 Total Likes
|
 Hi there,I am trying to work with Wolfram scripts (.wls) instead of notebook files (.nb), to increase Git compatibility.I am able to enter free-form inputs normally with "CTRL" + "=". The cell does not have the same display as in notebooks, but it works as expected. However, if I save the file and close it, on the next time I open it I have the following problems: the free-form input is substituted by a long expression: NamespaceBox["LinguisticAssistant",DynamicModuleBox[{Typesetquery$$="number of turkeys in Turkey",Typesetboxes$$=RowBox[{TemplateBox[{"\"Turkey\"",RowBox[{"Entity","[",RowBox[{"\"Country\"",",","\"Turkey\""}],"]"}],"\"Entity[\\\"Country\\\", \\\"Turkey\\\"]\"","\"country\""},"Entity"],"[",InterpretationBox[DynamicModuleBox[{EntityFrameworkFormattingPrivateopen=False},TemplateBox[{TemplateBox[{"\"livestock population\""},"ImplicitEntityPropertyBase"],TagBox[GridBox[{{TemplateBox[{RowBox[{" ","\"FAOLivestockType\""}],"\":\"","\"turkeys\""},"ImplicitEntityInfoRow"]}},GridBoxAlignment->{"Columns"->{{Left}}},DefaultBaseStyle->"GeneralizedEntityInfoGrid",GridBoxItemSize->{"Columns"->{{Automatic}},"Rows"->{{Automatic}}},GridBoxSpacings->{"Columns"->{{Automatic}},"Rows"->{{Automatic}}}],"Column"],Dynamic[EntityFrameworkFormattingPrivateopen],"\"EntityProperty[\\\"Country\\\", \\\"LivestockPopulation\\\", {\\\"FAOLivestockType\\\" -> \\\"Turkeys\\\"}]\"",TemplateBox[{"\"turkeys\""},"ImplicitEntityPropertySequence"]},"ImplicitEntityPropertyToggle"]],EntityProperty["Country","LivestockPopulation",{"FAOLivestockType"->"Turkeys"}],SelectWithContents->True],"]"}],Typesetallassumptions$$={},Typesetassumptions$$={},Typesetopen$$={1},Typesetquerystate$$={"Online"->True,"Allowed"->True,"mparse.jsp"->2.2858856.810599371295524,"Messages"->{}}},DynamicBox[ToBoxes[AlphaIntegrationLinguisticAssistantBoxes["",4,Automatic,Dynamic[Typesetquery$$],Dynamic[Typesetboxes$$],Dynamic[Typesetallassumptions$$],Dynamic[Typesetassumptions$$],Dynamic[Typesetopen$$],Dynamic[Typesetquerystate$$]],StandardForm],ImageSizeCache->{184.,{7.,16.}},TrackedSymbols:>{Typesetquery$$,Typesetboxes$$,Typesetallassumptions$$,Typesetassumptions$$,Typesetopen$$,Typesetquerystate$$}],DynamicModuleValues:>{},UndoTrackedVariables:>{Typesetopen$$}],BaseStyle->{"Deploy"},DeleteWithContents->True,Editable->False,SelectWithContents->True]  the substituted code does not work anymore, instead just outputting the full input: NamespaceBox["LinguisticAssistant", DynamicModuleBox[{Typesetquery$$ = "number of turkeys in Turkey", Typesetboxes$$= RowBox[{TemplateBox[{"\"Turkey\"", RowBox[{"Entity", "[", RowBox[{"\"Country\"", ",", "\"Turkey\""}], "]"}], "\"Entity[\\\"Country\\\", \\\"Turkey\\\"]\"", "\"country\""}, "Entity"], "[", InterpretationBox[ DynamicModuleBox[{EntityFrameworkFormattingPrivateopen = False}, TemplateBox[{TemplateBox[{"\"livestock \ population\""}, "ImplicitEntityPropertyBase"], TagBox[GridBox[{{TemplateBox[{RowBox[{" ", "\"FAOLivestockType\""}], "\":\"", "\"turkeys\""}, "ImplicitEntityInfoRow"]}}, GridBoxAlignment -> {"Columns" -> {{Left}}}, DefaultBaseStyle -> "GeneralizedEntityInfoGrid", GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Column"], Dynamic[EntityFrameworkFormattingPrivateopen], "\"EntityProperty[\\\"Country\\\", \ \\\"LivestockPopulation\\\", {\\\"FAOLivestockType\\\" -> \\\"Turkeys\ \\\"}]\"", TemplateBox[{"\"turkeys\""}, "ImplicitEntityPropertySequence"]}, "ImplicitEntityPropertyToggle"]], EntityProperty[ "Country", "LivestockPopulation", { "FAOLivestockType" -> "Turkeys"}], SelectWithContents -> True], "]"}], Typesetallassumptions$$ = {}, Typesetassumptions$$= {}, Typesetopen$$ = {1}, Typesetquerystate$$= {"Online" -> True, "Allowed" -> True, "mparse.jsp" -> 2.285885, "Messages" -> {}}}, DynamicBox[ ToBoxes[AlphaIntegrationLinguisticAssistantBoxes["", 4, Automatic, Dynamic[Typesetquery$$], Dynamic[Typesetboxes$$], Dynamic[Typesetallassumptions$$], Dynamic[Typesetassumptions$$], Dynamic[Typesetopen$$], Dynamic[Typesetquerystate$$]], StandardForm], ImageSizeCache -> {184., {7., 16.}}, TrackedSymbols :> {Typesetquery$$, Typesetboxes$$, Typesetallassumptions$$, Typesetassumptions$$, Typesetopen$$, Typesetquerystate$$}], DynamicModuleValues :> {}, UndoTrackedVariables :> {Typesetopen$$}], BaseStyle -> {"Deploy"}, DeleteWithContents -> True, Editable -> False, SelectWithContents -> True]  (Example from the Hands-on Start to Mathematica course.)I know that using the SemanticInterpretation function would be a solution to write free-form text in .wls files that survive saving/closing/re-opening. However, I would like a way that allows me to use the "CTRL" + "=" shortcut.Thank you,EDIT: I have recently found out that the "CTRL" + "=" shortcut works fine if the whole expression is directly given to a variable, as in the example below ("orange-equal" is the free-form input equal sign).turkeysInTurkey = "orange-equal" + "number of turkeys in Turkey"It is strange that if the free-form input sign is the first character in the line instead, then that line cannot be saved in a script file.
2 Replies
Sort By:
Posted 16 days ago
 While it is convenient to use "CTRL" + "=" in the front end, if you plan to use .wls files then it would be better to use WolframAlpha turkeyCode = WolframAlpha["number of turkeys in Turkey", "WolframParse"] ReleaseHold@turkeyCode `You can wrap that in a function to reduce typing.