Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I know it's possible to programmatically change options on the selection in a notebook. I'd like to create a button that lets me change the style of a cell. It's a style that doesn't have a keyboard shortcut, "ItemParagraph"

Something like

SetOptions[NotebookSelection[SelectedNotebook[]], CellStyle->"ItemParagraph"]

but CellStyle is for NotebookFind. Is there some way to do this? I just couldn't find the cell option I needed. I checked the Options for Cell but there are hundreds and I couldn't see anything that looked right...

share|improve this question
    
Yes, I have a palette open onscreen so a button on that palette would be much faster than going through the Format --> Style --> Item Paragraph menu. –  Tom De Vries Sep 24 '13 at 15:28
    
Maybe useful : mathematica.stackexchange.com/a/9956/363 –  Chris Degnen Sep 24 '13 at 15:28
    
I believe that post shows how to set the default for NEW cells... I am wondering how to select a cell and change whatever option would be to "ItemParagraph" –  Tom De Vries Sep 24 '13 at 15:43

1 Answer 1

up vote 3 down vote accepted

Maybe this button may help you:

Button["ItemParagraph", FrontEndExecute@FrontEndToken[SelectedNotebook[], "Style", "ItemParagraph"]]

The whole cell may be selected with:

SelectionMove[SelectedNotebook[], All, Cell]
share|improve this answer
    
Thank you so much, exactly what I was looking for, does just what I need, and helps me to see ways to use that for other things. –  Tom De Vries Sep 25 '13 at 21:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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