Page 1 of 1

Strikethrough

Posted: 2020-06-26 00:13:38
by paieye
Is there a macro for this ? If not, could some kind person tell me what are the steps that I need to take to create one ?

Re: Strikethrough

Posted: 2020-06-26 00:49:20
by xiamenese
Why do you need a macro? Why not just set a shortcut (Preferences > Menu Keys > Format > Strikethrough, where you can set shortcuts for different types of strikethrough, including colour)?

Just wondering.

Mark

Re: Strikethrough

Posted: 2020-06-26 02:51:06
by phspaelti
Mark, forever the sceptic about macros :wink:

Well, he's got a point. If all you are trying to do is apply strikethrough to the current selection, then there isn't much point to a macro. And depending on the task you may be better off using any combination of: a keyboard shortcut, using a character style, or Find and Replace.

A macro might be useful if you want it to be one step in a bigger task. Another use might be to create color specific strikethroughs.

In a macro to apply strikethrough to the current selection you can write on one line of the macro:

Code: Select all

Strikethrough:single
If you want to create a command that gives you hotpink strikethrough you can do it like this:

Code: Select all

$hotpink = Color.newWithHexTriplet 'FF69B4'
Set Strikethrough Color $hotpink
Strikethrough:single

Re: Strikethrough

Posted: 2020-06-27 06:24:50
by xiamenese
phspaelti wrote: 2020-06-26 02:51:06 Mark, forever the sceptic about macros :wink:

Well, he's got a point. If all you are trying to do is apply strikethrough to the current selection, then there isn't much point to a macro. And depending on the task you may be better off using any combination of: a keyboard shortcut, using a character style, or Find and Replace.
<snip>
Not really a sceptic! :) It's just that for most things I do, I don't need macros, so it intrigues me if someone wants a macro to do something like this and I wonder why.

I have one big macro—made largely by Martin for me—that I run all the time. I needed it to convert an RTF exported from Scrivener v.2—which only had a "format painter", so I used slight variations in colour that could be searched for—into proper styles in NWP, importing a style sheet, marking all Chinese for language and various other such things. Although, Scrivener v. 3 has styles, I still use the macro, though I don't have to rely on colour variations.

There are a couple of others I've downloaded that I do use periodically, but I'm not doing things that running macros would save me much time.

:)

Mark