Trouble getting the .removeStyle command to work
Posted: 2015-01-18 10:52:20
Hello friends,
I am new to the world of Nisus and working on my first macro so this may be a very stupid question. I need to write a macro which deletes some paragraph styles from the document it operates on.
I cannot figure out why this code does not work:
I get either: "Expected a Style object, not a Text object"
or: "Invalid variable assignment" (If I don't use the single quotes).
a similar command,
works as I would expect... it creates the paragraph style "Title"
I've combed the manual reference but can't figure out what I'm missing? What am I doing wrong?
I am new to the world of Nisus and working on my first macro so this may be a very stupid question. I need to write a macro which deletes some paragraph styles from the document it operates on.
I cannot figure out why this code does not work:
Code: Select all
$doc = Document.active
$doc.removeStyle ‘Header’
or: "Invalid variable assignment" (If I don't use the single quotes).
a similar command,
Code: Select all
$doc.addNewStyle ‘Paragraph’, ‘Title’
I've combed the manual reference but can't figure out what I'm missing? What am I doing wrong?