I thought I'd keep a running tally of what I know about these packets (excluding the obvious ones like `CreatePalettePacket`) just for reference. Admittedly what I know is very limited as of now.
###SimulateMouseMove / SimulateMouseDrag / SimulateMouseClick
`SimulateMouseMove` moves the mouse to a given screen position. Have yet to find a use for it, but it does allow one to play tricks on a user by putting something like:
Dynamic[
FEPacketExecute[
"SimulateMouseMove",
MousePosition[]
],
UpdateInterval -> 0
]
in a notebook. There might be an option for moving to a certain named position, e.g., `Center` but I haven't found it. I just wrote that into a wrapper function.
`SimulateMouseDrag` and `SimulateMouseClick` are similarly obvious:
`SimulateMouseDrag` takes a list of positions `{start, end}` and simulates a mouse drag between the two.
`SimulateMouseClick` just clicks on a position.
A sample usage:
FEPacketExecute["SimulateMouseDrag",
{{1200, 30}, {1200, 50}}];
FEPacketExecute[
"SimulateMouseClick",
{1200, 50}
];
On my Mac, with screen rectangle of `{{4, 1440}, {23, 900}}` this drags a window docked at the top right corner down 20 points.
The click is necessary, I found, to get the OS to recognize the mouse drag.
###AttachCell / DetachCell
Found [here](http://mathematica.stackexchange.com/a/99322/38205)
Used as
FrontEndExecute@
FrontEnd`AttachCell[obj: (_CellObject | _BoxObject),
cellExpr_,
{
radialDistanceFromAnchor: (_Integer | _Scaled),
alignment: {Center | Left | Right, Center | Bottom | Top}
},
anchor:
{
Center | Left | Right | _Scaled | _Integer | _Real,
Center | Bottom | Top | _Scaled | _Integer | _Real
},
"ClosingActions"->
{
(
"ParentChanged" | "EvauatorQuit" |
"OutsideMouseClick" | "SelectionDeparture" |
"MouseExit") ...
}
]
From Kuba, when attaching to a notebook using the `"ParentChanged"` setting will crash Mathematica as detailed [here](https://mathematica.stackexchange.com/a/134768/5478)
``FrontEnd`DetachCell`` simply detaches an attached cell.
###AddMenuCommands
Described [here](http://mathematica.stackexchange.com/a/915/38205)
Used as
FrontEndExecute@
FrontEnd`AddMenuCommands[menu,{items}]
where `menu` is the target menu and `items` are `MenuItem`/`Item` expressions or `Delimiter.
See also: http://mathematica.stackexchange.com/a/6227/38205
Which shows how to do this with a `"MenuList*"` menu.
###ResetMenusPacket
This can be used to both reset the menus and set an arbitrary `Menu` structure.
Used as:
FrontEndExecute@
ResetMenusPacket[{menu}]
where `menu` is either a `Menu` expression looking like
Menu["Mathematica", {menu_items_and_submenus}]
or `Automatic` as far as I've discovered. I'm sure there are more use cases but these are the ones I've found.
More info [here](https://mathematica.stackexchange.com/questions/133851/what-are-all-the-possible-menu-edits)
###SelectedObject
``FrontEndExecute@FrontEnd`SelectedObject[nb]`` returns whatever objects are selected in a notebook
###SetMouseAppearance
``FrontEndExecute[FrontEnd`SetMouseAppearance[expr_]]`` sets the mouse appearance
##Obvious but useful
###NotebookGetLayoutInformation
Provides useful information for anyone working with writing papers in mathematica as it gives access to cell sizes and page break info.
###NotebookDynamicToLiteral
Converts the current dynamic selection to its static displayed form.
###ObjectChildren
Provides access to the object heirarchy in a notebook. Particularly useful for getting the boxes in a given cell / box. At the `$FrontEnd` level though this will give you _all_ notebooks which is useful in and of itself.
##Warnings
Lots of these crash the system if used improperly. For example I haven't been able to get ``FrontEnd`UpdateKernelSymbolContexts`` to work without crashing Mathematica, using it bare, with `EvaluationNotebook[]`, or with `EvaluationCell[]`
A bare ``FrontEnd`UpdateDynamicObjects`` or ``FrontEnd`UpdateDynamicObjectsSynchronous`` also seems to crash the system and passing it an argument doesn't seem to do anything. (Too bad really, I was hoping I could use that as another way to manually update `Dynamic` objects).