Here is the search as I've done it so far. Selecting the "Captured1" and applying superscript is what causes the problem. Advice, anyone? Thank you!1 Zzxiixz ii Ziixzxzz ii Jiwxiizixz izzzixxixizčix xzzxxčizi Zizxz Jzxz ii Zizzxzixiz Jzzxiz Ziizixiz. Mzixxz ixwz ii izwxxz xxx Zizxx wxzx Jzxx ii Zizzxziizz Jzzzxz Ziizizxz.
2 Mzz xizxxwzi xzxxizwz Zizxxi xz ixz xizxz, wixzxzwi ixz zzxx wzixxzz, 3 xz xziixxxz wxzx Zizxx ii Jzxx zxixzizxxiz xiiziwixxzwi ixzx 1xzixz, xxii zxxziiz iixziiwzz, ii iiixzz, xxii zxxziiz wziiz, ii izixziwz, xxiiz zxxziiz xziixiixiz xiiiiz, zxxziz i wxzx Zizzxzii Jzzx Ziizix, 4 ii zixxxzwi, 2Zizxx xxwxiziizii xixiizi, ixzx iziixxiwz. 5 Zzz wxzx zxzxxziiiz xzzizix xzz ixz xizx iix zxxziziz, xzi izix xzi zx izxz, ii zx Zxzxiziz Zxzziz, ii zx xizizxx xziixiixixwx, xzix ixz zixxiz, xxxiz wzz izix ixzx xxxxwz ixzx izxxi.
Macro to change to superscript
Macro to change to superscript
I would like to take text like the following and put the bold numbers (which can be up to three-digits long, e.g. "150") in superscript. I would like them to remain bold. However, when trying to use PowerFind and apply superscript to the "Replace" text, the find dialog closes. (There is a non-bold space after the digits.)
Re: Macro to change to superscript
I have found using Powerfind Pro better when trying to do attribute replacement. Perhaps worth a try; if you just switch your S&R to Powerfind Pro, you shouldn't have to retype your strings.
Mark
Mark
Re: Macro to change to superscript
Thank you, Mark.xiamenese wrote:I have found using Powerfind Pro better when trying to do attribute replacement. Perhaps worth a try; if you just switch your S&R to Powerfind Pro, you shouldn't have to retype your strings.
Mark
I just switched it to PowerFind Pro. However, the problem is the same. (1) It finds all instances just fine, but (2) as it is in the following screenshot, it doesn't change to superscript, which is what I want. And, (3) when I click on the "apply superscript" icon, the S&R dialog box disappears, and it does not superscript anything. I must be doing something wrong, but I don't know what.
Re: Macro to change to superscript
You need to use the "Format > Baseline> Superscript" … that does it for me. If you use a button on your toolbar, that is on your document, not the find dialog, and clicking it takes you back to the document and so doesn't apply the superscript in the find dialog.

Mark

Mark
Re: Macro to change to superscript
Ahhh, thank you very much, Mark. That works!
Re: Macro to change to superscript
My pleasure!

Mark

Mark
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Macro to change to superscript
It sounds like Mark already gave you the solution — thanks Mark! — but I wanted to clear up one thing:
And one final tip: if you ever have trouble using a Find & Replace operation to change some text's formatting, remember that you can often break the problem down into two steps:
1. Find all of the desired text.
2. Apply formatting to the existing multi-part selection.
In this case you'd just find all the desired numbers, switch to the document window, and then use the palettes to add superscripting to the selected find results.
Assuming that the "apply superscript" icon is the one in the palettes, the Find dialog disappears because the palettes are attached to some document window. By clicking the palettes you activate the related document window, deactivating the Find dialog and thus hiding it. The core issue is thus that the palettes cannot be used to apply formatting to the Find dialog; you must use the main menu (or keyboard shortcuts).NisusUser wrote:when I click on the "apply superscript" icon, the [Find & Replace] dialog box disappears, and it does not superscript anything
And one final tip: if you ever have trouble using a Find & Replace operation to change some text's formatting, remember that you can often break the problem down into two steps:
1. Find all of the desired text.
2. Apply formatting to the existing multi-part selection.
In this case you'd just find all the desired numbers, switch to the document window, and then use the palettes to add superscripting to the selected find results.
Re: Macro to change to superscript
Ahh, now I understand. Makes sense. I'll have to remember that. Thank you.martin wrote:The core issue is thus that the palettes cannot be used to apply formatting to the Find dialog; you must use the main menu (or keyboard shortcuts).
I could have done that, but I wanted to create a macro so I would be able to do it again quickly.martin wrote:And one final tip: if you ever have trouble using a Find & Replace operation to change some text's formatting, remember that you can often break the problem down into two steps:
1. Find all of the desired text.
2. Apply formatting to the existing multi-part selection.
In this case you'd just find all the desired numbers, switch to the document window, and then use the palettes to add superscripting to the selected find results.
Thanks for your follow-up, Martin.
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Macro to change to superscript
Ah okay, though you can still break apart the steps for a macro. It might look something like this:NisusUser wrote:I could have done that, but I wanted to create a macro so I would be able to do it again quickly.martin wrote:And one final tip: if you ever have trouble using a Find & Replace operation to change some text's formatting, remember that you can often break the problem down into two steps:
1. Find all of the desired text.
2. Apply formatting to the existing multi-part selection.
Code: Select all
Find All "[[:digit:]]+", "E"
Menu "Superscript"
Code: Select all
If Find All "[[:digit:]]+", "E"
Menu "Superscript"
End
