Page 1 of 1

text editing macros

Posted: 2007-07-17 08:14:00
by Thomas C. Wolfe
I am a new user and am wondering two things:
can one write text editing macros in Nisus Pro and can one start macros with keyboard commands?

you can do this in my previous word processor, M....... W..., and I appreciate the speed with which one can delete sentences, words, etc. with a keystroke combination.

Thanks,
Tom

Posted: 2007-07-17 13:07:58
by martin
Hi Tom,

You certainly can write text editing macros in NWP. If you have any specific macro in mind, please let me know.

As for keyboard commands, I'm not sure I understand exactly what you're after. You can trigger the menus associated with keyboard commands in macros, eg: your macro would contain the command "New" instead of something that specified Command + N. I hope that makes sense- let me know if you're thinking about something else.

~Martin

Clarification

Posted: 2007-07-17 14:26:02
by Thomas C. Wolfe
Thanks for the reply, Martin, I can be more specific.

I was thinking of two things.

First, cursor movement. I am addicted to the old old wordstar cursor movement commands: ctrl-A is word left; ctrl-S is character left; ctrl-D is character right; and ctrl-F is word right. This sort of thing.

And secondly, edits such as: ctrl-J deletes the rest of the sentence to the right of the cursor. And ctrl-W deletes the word the cursor is in.

In Microsoft word I can either program them in the Keyboard customization area, or I can record small macros to do this work.

I know that there are ways to move the cursor around in OSX, it is just that I am much more comfortable with these old ways.

Is there anyway to do this sort of thing in NWP?

Thanks,
Tom

Posted: 2007-07-17 15:29:33
by martin
Ah, I think I see what you are looking for now Tom. OSX has most of these things built-in. For example, Option + Right Arrow moves you to the next word, Option + Delete deletes the preceding word, etc. Here is a list that someone has compiled.

ah ha.

Posted: 2007-07-17 19:36:08
by Thomas C. Wolfe
But there is no way to make one's own within Nisus, correct?

Posted: 2007-07-17 23:32:24
by martin
You can certainly create a macro that manipulates the selection or deletes bits of text. Those macros could then be assigned keyboard shortcuts in NWP preferences.

sample macro

Posted: 2007-07-18 09:00:35
by Thomas C. Wolfe
Martin, please tell me if this request is asking for help that you are too busy to provide. You must receive many questions. But if you could give me an example of say, the text of a macro that would highlight a sentence and then delete it, I could probably write the other ones on my own. I understand that macros are essentially lists of commands taken from the menu bar, but I don't see those commands for such basic things as cursor movement and turning selection on and off on the menu bar. Again, I can make do with the old Cocoa commands (thanks for the list), but if possible I would like to get back to my old keyboard commands.

(Or is there any chance that an upcoming version of NWP would have the ability to record macros?)

Thanks for your help.

Posted: 2007-07-18 16:12:13
by martin
Hi Thomas, it's no problem. I've created the macros you asked for and placed them in our macro repository.

As for recording macros, I'm not sure if we'll see this any time soon, sorry.

Posted: 2007-07-20 01:58:33
by js
[quote="martin"]Hi Thomas, it's no problem. I've created the macros you asked for and placed them in our macro repository.

Your sentence selecting macro won't do with a sentence like: "Drinking milk (cf. A. Porter: The softdrink in the Americas) is healthy." Could it be done at all?

thanks

Posted: 2007-07-20 08:22:49
by Thomas C. Wolfe
Thanks so much, Martin, for the macros. They are very useful.

Pushing the support limit

Posted: 2007-07-25 09:02:00
by Thomas C. Wolfe
Dear Martin,
I know I am pushing the customer support limit, but I cannot figure out how to write four (probably simple) macros. If you have a moment, I would be very grateful if you could do this.
1. to move the cursor to the next word
2. to move the cursor to the previous word
3. to delete the word the cursor is in
4. to delete the previous word

I know these are all possible to do with the default key bindings, but the key thing is to be able to map them onto combinations using regular letters of the keyboard. I like the program very much but I am so used to the old ways!

Thanks
Wordstar Wolfe

Posted: 2007-07-25 12:31:17
by martin
Here you are Thomas, I hope these macros do the job for you!

Posted: 2007-07-25 12:46:14
by martin
js wrote:Your sentence selecting macro won't do with a sentence like: "Drinking milk (cf. A. Porter: The softdrink in the Americas) is healthy." Could it be done at all?
I suppose it is possible, it's just a matter of figuring out all unambiguous cases where a period does not indicate the end of a sentence. Some rules that your example sentence illustrates:

1. The period does not follow a single letter.
2. The period does follow a common abbreviation. We'd need to think of a list of these. Using google I've found this list, which seems pretty good.

The problem with rule number two is that an abbreviation may terminate a sentence, eg: "I live on Sapphire Blvd." In this case the macro is out of luck. Would you be be interested in an updated macro that incorporates these rules?

Posted: 2007-07-27 08:48:41
by js
martin wrote:
js wrote:Your sentence selecting macro won't do with a sentence like: "Drinking milk (cf. A. Porter: The softdrink in the Americas) is healthy." Could it be done at all?
I suppose it is possible, it's just a matter of figuring out all unambiguous cases where a period does not indicate the end of a sentence. Some rules that your example sentence illustrates:

1. The period does not follow a single letter.
2. The period does follow a common abbreviation. We'd need to think of a list of these. Using google I've found this list, which seems pretty good.

The problem with rule number two is that an abbreviation may terminate a sentence, eg: "I live on Sapphire Blvd." In this case the macro is out of luck. Would you be be interested in an updated macro that incorporates these rules?
Martin, thanks for asking. I don't think that I would use such a macro often, all the more that it should work also for other languages than enlish. Basically I was interested in how it can be done, to get a better grip on macro writing by learning from you. It's good to have this kind of help.

Best

js

Posted: 2007-07-27 11:51:33
by martin
No problem js, I'm glad you find it useful!