Would you be willing to share? I used to have a ton of macros in Word that did this (assigned to fn keys) and miss them in NWE.Jzents wrote:I have some macros that I wrote to add "canned" comments to papers I am grading. I do not want them to add a space in front of the pasted text, but they do. Does anyone know a trick to make that stop or is that the bug reappearing in a new place.
Macros in 2.5
Re: Speaking of the space
Re: Speaking of the space
Sure, happy to. Email me at me address in the signature line and I will send you a .zip file with them in it. Cheers!midwinter wrote:Would you be willing to share? I used to have a ton of macros in Word that did this (assigned to fn keys) and miss them in NWE.Jzents wrote:I have some macros that I wrote to add "canned" comments to papers I am grading. I do not want them to add a space in front of the pasted text, but they do. Does anyone know a trick to make that stop or is that the bug reappearing in a new place.
Jeffrey Zents
jzents@mac.com
jzents@mac.com
Re: creating Macros
In NWClassic I have got a Shortcut assigned to the Macro "Transpose the Two"cgc wrote:
How often do you do this? Just curious...
//==================== MACRO Transpose the Two
// Assuming two things are non-contiguously selected, this will transpose them, putting each in the place of the other
s->push(startends)
if(s->size!=4) goto warn
4
setselect(s[3],s[4])
MacroCopy
setselect(s->pop,s->pop)
Swap Paste
setselect(s->pop,s->pop)
Paste
0
exit
warn:
beep
:1 "This macro requires two non-contiguous selections."
exit
because I very often change the position of words, sentences and paragraphs. Probably ten times a day.
This is quiet an advanced macro, but the trandposing of two letters in NWC is a laugh to create.
Find Next "\(.\)\(.\)" "oO-SAir-wt-Gg"
Replace With "\2\1" "oO-SAir-wt-Gg"
Via the Marcoize button.
What would I give for an easy Macro language in NWE and a Macroize Button in F/R.
Best, Matze
Re: Missing an integrated macro language
Hello dshan!dshan wrote:But if NWX had it's own scripting language you'd still have to "learn another programming language": NWX's language.
I have to disagree here.
Learning NWCs Macro language was nothing compared to learning PERL.
The most macros I have written for NWC were done by typing menucommands into the macrofile or use some Find/Replace Expressions (via the Macroize-Button.)
Reading the Macro Chapter in Joe Kissels The Nisus Way and you had the skills for writing very helpfull macros.
To do that in Perl you just have to study programming!
Best, Matze
How much pain for how much gain?
This is somewhat my point. In Word for instance, there's a lot of help for people who are somewhat computer savy, but don't write code 24/7. You can record macros to get the basic syntax, then you can edit the resulting macro to add any more specific customization. If you want more ideas on a function or command, it's only a click away in the help file. I could go on...Learning NWCs Macro language was nothing compared to learning PERL.
Perl is apparently a good and popular programming/scripting language, but you have to learn an awful lot about it before you can use it -- not an investment of time that all writers might want to justify. Just having a macro recorder in Nisus would be a great help.
Re: creating Macros
Matze,Matze wrote: In NWClassic I have got a Shortcut assigned to the Macro "Transpose the Two"
//==================== MACRO Transpose the Two
// Assuming two things are non-contiguously selected, this will transpose them, putting each in the place of the other
[Deleted]
because I very often change the position of words, sentences and paragraphs. Probably ten times a day.
This is quiet an advanced macro, but the trandposing of two letters in NWC is a laugh to create.
Find Next "\(.\)\(.\)" "oO-SAir-wt-Gg"
Replace With "\2\1" "oO-SAir-wt-Gg"
I can't see how to transpose two non-contiguous selections with a NWX Perl macro alas (if anyone does know how I'd like to see the code). Non-contiguous selections seem to be copied to the clipboard (and then passed to Perl) by NWX as one contiguous string and you can't paste/replace into noncontiguous selections from the clipboard either unfortunately.
However, your second macro - to transpose selected contiguous characters (two or more) - is easy to do in Perl:
Code: Select all
#Nisus Macro Block
#source clipboard
#destination clipboard
#Before Execution
#Copy
#After Execution
#Paste
#End Nisus Macro Block
while (my $line = <>) {
print (join("",reverse(split(//, $line))));
}
Re: creating Macros
Hi dshan,
oh, I didn't want to make you think about how to write this macro in PERL, I just wanted to give an example how easy it is to write macros in NWC and how difficult in Perl/NWE
But it also proofs my point: Perl is difficult, NWC macro language is easy!
Loads of parantheses, many different commands, a syntax that doesn't explain itself immediately.
The NWC macro on the other hand can be created by just using the Find/Replace Window. In power find or pf pro choose two characters each in parantheses from the F/R menu for "Find" and "Found2 Found1" from the same for Replace, hit the Macroize button, give the macro a name, and you're done!
I hope, that this will be availabe in NWE sometimes.
Best, Matze
dshan wrote: I can't see how to transpose two non-contiguous selections with a NWX Perl macro alas
oh, I didn't want to make you think about how to write this macro in PERL, I just wanted to give an example how easy it is to write macros in NWC and how difficult in Perl/NWE
Great, I thank you very much for this one!dshan wrote: However, your second macro - to transpose selected contiguous characters (two or more) - is easy to do in Perl:
Code: Select all
#Nisus Macro Block #source clipboard #destination clipboard #Before Execution #Copy #After Execution #Paste #End Nisus Macro Block while (my $line = <>) { print (join("",reverse(split(//, $line)))); }
But it also proofs my point: Perl is difficult, NWC macro language is easy!
Loads of parantheses, many different commands, a syntax that doesn't explain itself immediately.
The NWC macro on the other hand can be created by just using the Find/Replace Window. In power find or pf pro choose two characters each in parantheses from the F/R menu for "Find" and "Found2 Found1" from the same for Replace, hit the Macroize button, give the macro a name, and you're done!
I hope, that this will be availabe in NWE sometimes.
Best, Matze