Help - Search - Members - Calendar
Full Version: For those who hate going back to hyphenate
Productivity Talk > Commands|Glossaries|Dictionaries > ShortHand Commands
Harrie
Of course, the real solution is to have all the entries that need hyphenating in already! But that isn't always reality, is it.

So, let's say you type:

Osgood Schlatter's disease - and afterwards, you realize you need a hyphen. You'll have to jump back two words and put it in. Or, you can use this command, and maybe name the short form h2 if you'd like.

And then, sometimes you might only have typed Osgood Schlatter's, two words, so you only need to jump back one word. Maybe "h1" for this short form, perhaps?

So......they look thus in your Text to Type box in Shorthand:

For jumping back and inserting it two words back:
{@KEY Ctrl+Left}{@KEY Ctrl+Left}{@KEY Left}{@KEY -}{@KEY Del}{@KEY End}{@NOSPACE}

For jumping back one word:
{@KEY Ctrl+Left}{@KEY Left}{@KEY -}{@KEY Del}{@KEY End}{@NOSPACE}
mmilt
S_bravo.gif THIS IS SO COOL! eclipsee_Victoria.gif
Harrie
grin.gif grin.gif
Hillbillie
Long time no see. I have been a busy little bee but it is good to get back to this gold mine of information. Thank you so much for this code. I have been forced to switch expander programs and finding myself overwhelmed to say the least. I have tried to still use Instant Text with my new transcription platform and it works okay but some of the program shortcuts for the new program I am using are the same as some of the other shortcut keys for other programs I use for research, i.e. Stedmans electronic wordbooks. Also I tried to write script for a command in Instant Text to do a hypertexted blank and Instant Text would not complete the command so I thought I would bite the bullet and take the bull by the horns at the same time, LOL. I know I can change the shortcut keys for the Stedman's word books but when I could not get Instant Text to make a hypertexted blank for my new transcription platform I thought then it was time to switch. You all are the greatest.
Harrie
Hi, hillbillie, yes it has been a long time!

For this same code in Instant Text, for 2 words back:

{command}{Ctrl Left}{Ctrl Left}{Left}-{Delete}{End}_

For 1 word back:

{command}{Ctrl Left}{Left}-{Delete}{End}_

It's hard to see but the hyphen is in there. You can copy and paste those, or even better, get used to doing them manually. Simply go to your add dialog in Instant Text, hit Alt + C for "Command", then perform the first keystroke which is Ctrl + Left. Then Alt + C again, and the next keystroke. Etc until you are done. The underscore character at the end is so that you will not have an unwanted space.

Hillbillie, I don't actually know what a hypertexted blank is. If you can explain, maybe we can help show how to do it in Instant Text. (A new thread in Instant Text commands would be best, of course). Thanks.
Hillbillie
I am sorry for the confusion. I am switching to Shorthand from Instant Text. I would rather not but circumstances are going to force me into it I think.
Shari Suek
Thanks for this! I'm just starting with a trial of ShortHand and am considering purchasing it. I love not having to reinvent the wheel on these things!

Thanks much!!!!
Kiwi55
I am trying to write a command to delete a hyphen and cannot seem to get it to work. I have to admit I am a rank newbie at writing commands!

For example, when editing, if I see that a word is hyphenated and it should not be, I would like a command to remove the hyphen from in front of the word (and also one from the end of the word).

e.g. well-developed to well developed

I have tried the following with the cursor placed in front of the word:

{@KEY Ctrl+Right}{@KEY Del}{@KEY Space}{@KEY Ctrl+Right}{@NOSPACE}

It not only does not remove the hyphen, it also drops me down to the beginning of the next line like a hard return. Any ideas on what to change to get this to work?

Thanks

Jen
Harrie
Jen, try this one:

{@KEY Ctrl+Right}{@KEY Del}{@KEY Space}{@KEY End}
Kiwi55
QUOTE (Harrie @ Jun 24 2009, 08:19 PM) *
Jen, try this one:

{@KEY Ctrl+Right}{@KEY Del}{@KEY Space}{@KEY End}


Unfortunately, that does not work either. Now it does not give me the hard return, but the hyphen is still there and the cursor is 2 spaces past the hyphenated word I was trying to delete the hyphen from. Thanks for trying.

Jen
Harrie
Jen, are you using Word or something else? You should be able to duplicate the steps you take to do it manually and have your command. If that's not working, I admit to being stumped!
Ed Weber
If using Word, this macro will probably be faster and smoother than a script. The macro will look backward from the cursor and change the first hyphen it finds to a space. If it finds no hyphen within 50 characters or reaches the start of the document, it will so state in the status bar and do nothing. The default 50 character search area can be changed by changing the value of the intStop variable.

CODE
Sub DeleteHyphen()
Dim rng As Range
Dim rngSel As Range
Set rng = Selection.Range.Duplicate
Set rngSel = Selection.Range.Duplicate
Dim j As Integer
Dim intStop As Integer
Dim Msg As String
Dim blFound As Boolean
j = 0
intStop = 50
With rng
  Do Until Left(.Text, 1) = "-" Or rng.Start = ActiveDocument.Range.Start
    .Start = .Start - 1
    j = j + 1
    If j = intStop Then
      rngSel.Select
      Selection.Collapse wdCollapseEnd
      StatusBar = "Search character not found within " & Str(intStop) & " characters of cursor"
      End
    End If
  Loop
  If rng.Start = ActiveDocument.Range.Start Then
    StatusBar = "The search has reached the start of the document"
    rngSel.Select
    rng.Collapse wdCollapseEnd
    End
  End If
  .End = .Start + 1
  .Delete
  .InsertBefore " "
End With
If j = 1 Then rngSel.Start = rngSel.Start + 1
rngSel.Select
End Sub
Kiwi55
Harrie and Ed,

First I would like to thank you for your ideas. I am not working in Word. In fact, I am playing with setting these up in Notepad. So far, the commands I have managed to get to work successfully in notepad have also worked in my employer's proprietary platform.

In notepad, when I have my cursor at the beginning of well-developed, I have not found a keystroke or combination of strokes that gets the cursor to the hyphen. If I try Ctrl+Right, it jumps to the end without stopping at the hyphen. If I just used the right arrow it only moves one letter at a time. I think that may be my problem. Any other ideas or is this just not possible?

Thanks again.

Jen
Ed Weber
QUOTE (Kiwi55 @ Jun 25 2009, 04:12 PM) *
Harrie and Ed,

First I would like to thank you for your ideas. I am not working in Word. In fact, I am playing with setting these up in Notepad. So far, the commands I have managed to get to work successfully in notepad have also worked in my employer's proprietary platform.

In notepad, when I have my cursor at the beginning of well-developed, I have not found a keystroke or combination of strokes that gets the cursor to the hyphen. If I try Ctrl+Right, it jumps to the end without stopping at the hyphen. If I just used the right arrow it only moves one letter at a time. I think that may be my problem. Any other ideas or is this just not possible?

Thanks again.

Jen


NotePad is a text editor, not a word processor. It is designed for creating text documents such as program source code. It was never intended for this type of use and lacks the controls that word processors have. I doubt that you will ever be able to automate it to any extent..You might want to try WordPad (which is included with Windows) or the free Open Office but Word macros will not work with either. I recommend buying a used copy of Word 2000, 2002, or 2003, but not Word 97. Word 2007 will be fine but I personally do not like its interface and consider it to be the software equivalent of New Coke (however, I doubt that MS will recant as the Coca-Cola Company did).
Kiwi55
NotePad is a text editor, not a word processor. It is designed for creating text documents such as program source code. It was never intended for this type of use and lacks the controls that word processors have. I doubt that you will ever be able to automate it to any extent..You might want to try WordPad (which is included with Windows) or the free Open Office but Word macros will not work with either. I recommend buying a used copy of Word 2000, 2002, or 2003, but not Word 97. Word 2007 will be fine but I personally do not like its interface and consider it to be the software equivalent of New Coke (however, I doubt that MS will recant as the Coca-Cola Company did).
[/quote]

Ed,

Thank you for the information on NotePad. With that information in hand, I tried the commands that I could not get to work in NotePad on my platform when I was working and was happy to find that they work on my platform. I had not been trying to set up new commands directly on the platform, because I only have access to it when I have a live report I am working on open, and I do not want to spend my production time trying to set up commands. My work computer is provided by my employer and I am not allowed to download anything onto it, which is why I was mucking around on NotePad in the first place.

Thanks again for your help.

Jen
Karla12
I would love this macro but it didn't work for me, but I wonder if it is because I use nonbreaking hyphens and not regular hyphens. Can this be modified for that. Also I need one that just removes the hyphen but doesn't insert a space - making a hyphenated word into one word and not two.

Karla
Ed Weber
QUOTE (Karla12 @ Sep 15 2009, 10:14 AM) *
I would love this macro but it didn't work for me, but I wonder if it is because I use nonbreaking hyphens and not regular hyphens

Yes
QUOTE
Can this be modified for that
.
Change "-" to Chr(160) no quotes.
REMARK ADDED LATER: The 160 was in my original post so I won't change it, but it was an error. The correct modification is Chr(30)

QUOTE
Also I need one that just removes the hyphen but doesn't insert a space - making a hyphenated word into one word and not two.

Either type an apostrophe in front of .InsertBefore " " or delete the entire line
Ed Weber
Oops! the Chr(160) referred to in the previous post should have been Chr(30). I had been working on a different project involving nonbreaking spaces, Chr(160), and I had a brain spasm.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.