# Items known by CurrentValue

CurrentValue can be used to poll the state of numerous system values such as the mouse position. Its help page doesn't list all possible items, though. An item like "TooltipFontFamily" isn't listed but it works nevertheless:

In[49]:= CurrentValue["TooltipFontFamily"]
Out[49]= "Segoe UI"


My question is: where can I find a (more) complete list of items that can be used with CurrentValue. Or, alternatively, how could I programmatically generate such a list?

EDIT

Based on John Fultz' answer I wrote the following:

Union[
Flatten[
Cases[
Import[#], HoldPattern[CurrentValue[a_]] :> a, Infinity
] & /@ FileNames[#] & /@
{
FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "StyleSheets", "*.nb"}], FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd",
"TextResources", "*.nb"}],
FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "SystemResources", "*.nb"}] }, 2 ] ]  and got this: (* ==> {CommandKey, ControlKey, ControlsFontFamily, ControlsFontSize, DefaultButtonSize, DefaultNewGraphics, HyperlinkModifierKey, LicenseValid, MenuFontFamily, MouseButtonTest, MouseClickCount, MouseOver, NotebookSelected, OptionKey, PanelBackground, PanelFontFamily, PanelFontSize, ScreenArea, ShiftKey, ToolbarBackground, TooltipFontFamily, TooltipFontSize, TooltipFrameMargins, Enabled, Language, {ControlsFontSize, Large}, {ControlsFontSize, Medium}, {ControlsFontSize, Small}, {SystemColor, DialogText}, {SystemColor,DialogTextDisabled}, {SystemColor, MenuText}, {SystemColor, Tooltip}, {SystemColor, TooltipFrame}, {SystemColor, TooltipText}, {TaggingRules, Highlight}, {ScreenRectangle, 1, 2}, {ScreenRectangle, 2, 2}} *)  in addition to a message complaining about: Syntax::sntufn: Unknown unicode longname NumberComma.  Other items known by CurrentValue (not in the list above) that were used in answers/comments here: • As per this comment by celtschk: {"Thickness", "Opacity", "Dashing", "FontFamily", "FontSize", "FontSlant", "FontWeight", "FontColor", "FontOpacity"}  - given the comments to answers below I think a more interesting, and separate, general question would be how do you find out a list of all the built in option strings. – Mike Honeychurch Feb 6 '12 at 0:40 out of curiosity is anyone planning to ask Wolfram about how to find all these strings? I will but don't want to double up if someone else already has or is about to? – Mike Honeychurch Feb 6 '12 at 3:56 ok I logged the question -- finding all option strings/string options with tech support – Mike Honeychurch Feb 6 '12 at 9:08 @mike Thanks! Will you be reporting back here? – Sjoerd C. de Vries Feb 6 '12 at 11:38 @SjoerdC.deVries I got a fast reply: "Since these do not have any context like a symbol would, there isn't any real programmatic way of accumulating them. It's possible to scrape the documentation for these, but not very simply." ...but looks like John Fultz has provided a pointer below. – Mike Honeychurch Feb 6 '12 at 20:53 show 3 more comments ## 5 Answers Other answers have already suggested ways of querying options. There's no way of systematically generating a list of all string values, but it's not too difficult to put together a list of all of the values which are used by Wolfram Research in Mathematica itself. If you look in the various files in these locations: • $InstallationDirectory/SystemFiles/FrontEnd/StyleSheets
• $InstallationDirectory/SystemFiles/FrontEnd/TextResources • $InstallationDirectory/SystemFiles/FrontEnd/SystemResources

for instances of CurrentValue, you'll get a pretty good list of what is in active use by Wolfram Research developers at any given time. Most of the undocumented string values are created specifically to fulfill a purpose required by one of these files, so that's a pretty good list.

There may be a few others used directly by the kernel but not anywhere in these files, but if so, not many. Any undocumented string values which are not in use by the product somewhere are likely to be untested as well, so if you're tempted to complain that this list isn't absolutely complete, be careful what you wish for.

-

Perhaps: using

  systemnames = Names["System*"];
Select[systemnames, CurrentValue[#] =!= $Failed &]; CurrentValue /@ % // Short (* ==> {False, {FrontEndFileName[{$UserBaseDirectory, "Autoload"}],  ... }
*)


for the System context, and replacing System with the appropriate context name for other members of the list Contexts[]?

-
+1 for the idea: asking the system is so much better than trusting the documentation :-). Unfortunately this will not find things that are only available as strings as the OPs example. My answer is even worse in that respect... –  Albert Retey Feb 5 '12 at 23:34
Also very nice, but Cases[Names["System*"],"TooltipFontFamily"] yields {}. –  Sjoerd C. de Vries Feb 5 '12 at 23:40
@kguler I liked the example you removed in your latest edit. If you'd ask me I would have kept it. –  Sjoerd C. de Vries Feb 6 '12 at 11:44
@Sjoerd, I was not quite sure if the example that I erased was correct; I wanted to make sure that it was not a fluke due to corruption in my ContextPath after trying to do too many things in a single session. I will check and update if can verify that it was correct. Meanwhile, I hope there will be a response from WR to Mike's logged question soon. –  kguler Feb 6 '12 at 12:04
I didn't have mma available when I read your previous edit, but now that I have I don't see "TooltipFontFamily" in the Global  context; Context["TooltipFontFamily"] doesn't work as you showed. Come to think of it, can strings live in a context? –  Sjoerd C. de Vries Feb 6 '12 at 18:07
show 1 more comment

To my understanding CurrentValue adds an alternative syntax to what Options and SetOptions provide for the frontend and notebooks. So in addition to what's documented I think Options[$FrontEnd] and Options[Notebook] would be a good starting point. These are what I usually consult when searching for something. - That certainly yields a lot of options but the example I gave ("TooltipFontFamily") is not among them. That suggests there must be more options to be found than only those. In those list most of the options are not strings BTW, whereas most of the values listed in the CurrentValue doc page are strings. – Sjoerd C. de Vries Feb 5 '12 at 23:36 @SjoerdC.deVries: you are absolutely right about the fact that my list is not complete, and I know that very well. You should keep in mind that many options can nowadays be given as strings or as a symbol, try e.g. CurrentValue[AutoIndent] vs. CurrentValue["AutoIndent"]. Something that is also not clear to me is why there is a TooltipBoxOptions -> {"DefaultLabelStyle" -> "TooltipLabel"} and CurrentValue["TooltipFontFamily"] and if and how they are connected. Looks like a rich field for experiments... – Albert Retey Feb 5 '12 at 23:47 add comment Basing on Sjoerds self answer, you were missing the subdirectories. I added that and the tr files (don't know if it was worth something). Probably I'm missing some others because this doesn't check box structures, but it does get a few extras fnames = FileNames[ "*.nb" | "*.tr", {FileNameJoin[{$InstallationDirectory, "SystemFiles",
"FrontEnd", "StyleSheets"}],
FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "TextResources"}], FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd",
"SystemResources"}]}, Infinity];

fimps = Import[#, "Text"] & /@ fnames;

DeleteDuplicates@
Flatten@StringCases[fimps,
Shortest[
"CurrentValue[" ~~ (i___ /;
SameQ @@ (StringCount[i, #] & /@ {"[", "]"})) ~~ "]"]] //
StringReplace[#, Whitespace -> ""] & //
MakeExpression[#, StandardForm][[1, 1]] & /@ # & //
DeleteDuplicates//Sort


You get

{
{"CellCount"},
{"CommandKey"},
{"ControlKey"},
{"ControlsFontFamily"},
{"ControlsFontSize"},
{"CurrentFormatTime"},
{"DefaultButtonSize"},
{"DefaultNewGraphics"},
{"GraphicsBoxOptionsImageSizeRaw"},
{"Magnification"},
{"MouseButtonTest"},
{"MouseClickCount"},
{"MouseOver"},
{"MousePosition"},
{"NotebookFileName"},
{"NotebookSelected"},
{"OptionKey"},
{"PanelBackground"},
{"PanelFontFamily"},
{"PanelFontSize"},
{"PluginEnabled"},
{"PreviousFormatTime"},
{"ScreenArea"},
{"SelectionData"},
{"SelectionOver"},
{"ShiftKey"},
{"ToolbarBackground"},
{"TooltipFontFamily"},
{"TooltipFontSize"},
{"TooltipFrameMargins"},
{"WindowSize"},
{dialog},
{Enabled},
{HomePage},
{Inherited},
{$CellContextinputnb$$}, {Language}, {Magnification}, {nb}, {CellContextnb}, {CellContextnb$$}, {FrontEndSelectionObject}, {target}, {WindowFrame}, {WindowSize}, {WindowTitle}, {FrontEnd$ActivationDialog},
{$Failed}, {FrontEnd$FrontEnd},
{FrontEndButtonNotebook[]},
{FrontEndEvaluationNotebook[]},
{FrontEndObject[
{FrontEndInputNotebook[]},
{{"ControlsFontSize", Large}},
{{"ControlsFontSize", Medium}},
{{"ControlsFontSize", Small}},
{{"ControlsFontSize", Tiny}},
{{"ControlsFontSize", #5}},
{{"ModifierKeys", "Command"}},
{{"SystemColor", "DialogText"}},
{{"SystemColor", "DialogTextDisabled"}},
{{"SystemColor", "Tooltip"}},
{{"SystemColor", "TooltipFrame"}},
{{"SystemColor", "TooltipText"}},
{{ButtonBoxOptions, ButtonData}},
{{TaggingRules, "Highlight"}},
{{WindowSize, 1}},
{{WindowSize, 2}},
{{"ScreenRectangle", 1, 2}},
{{"ScreenRectangle", 2, 2}},
{{ConversionOptions, "ImportOptions", "PDF", "Editable"}},
{{ConversionOptions, "ImportOptions", "PDF", "Pages"}},
{NotebookObject[
FrontEndObject[

In addition to the other very useful answers, I'd like to start a collection of links to posts mentioning interesting CurrentValue items: