That's because the macro language only does basic variable interpolation inside double-quote marks. That means replacing "$targetStyle" with its current value, but not anything more complicated like "$targetStyle.name" or "$styles[3]".# 1) Menu State “:Format:Lists:$targetStyle.name” did not work
# assigning $targetStyle.name to variable and using in Menu State did
Replacing list numbers with their values
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Replacing list numbers with their values
Great David, thanks for posting your final macro- it looks good to me.
Another macro
The following macro is based on a different approach recommended by Martin two years ago:
http://nisus.com/forum/viewtopic.php?f=18&t=3921
Note that Step 1 (Convert to Fixed Content) preserves the current selection, but I don’t know how to limit Step 2 to the current selection. Perhaps Martin can help.
http://nisus.com/forum/viewtopic.php?f=18&t=3921
Note that Step 1 (Convert to Fixed Content) preserves the current selection, but I don’t know how to limit Step 2 to the current selection. Perhaps Martin can help.
Code: Select all
# 1. Convert all Cross-References (dependent claims) to plain text:
Select All
Menu ‘:Tools:Automatic Content:Convert to Fixed Content’
# 2. Convert all list numbers (list bullets) to plain text:
# Go backwards from end of document so numbering doesn't change as we progress.
Select Document End
While Select Previous List Item # “Previous” goes backwards.
$selection = TextSelection.active
$bullet = $selection.substring
# Prevents list numbering from being re-created by paragraph style:
Menu ':Format:Lists:Use None'
Write Selection $bullet
End