Transpose letters--Word command or AppleScript?

A

AstroGuy

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

I used to have a spiffy Word 2004 macro to transpose two letters. It's something I've relied on in every word processor I've used since the days of Word Perfect. Years ago, Stewart Brand in the Whole Earth Catalog wrote about the importance of macros and emphasized how cool and useful a transpose macro was. He was right!

Alas, with VBA gone, I'm at sea on this.

I'm daunted by AppleScript, especially the labyrinth of the Word dictionary. I'm hoping that someone has already written a script for this or can walk me through how to do it. Or, maybe there's a buried command within Word somewhere that I'm missing!

I have set up an iKey macro that does a transpose, but it's a tad slow. The Word 2004 macro I had was instantaneous, so I'm all ready for a speedy AS solution!
 
A

AstroGuy

BUMP!

The key has to be how to select a letter behind the cursor, then select Move Text (not cut or copy as that would clear the clipboard), etc.
 
J

John McGhie

You can't "bump" things in here, it has no effect.

You have to wait until someone who knows the answer comes along.


BUMP!

The key has to be how to select a letter behind the cursor, then select Move
Text (not cut or copy as that would clear the clipboard), etc.

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
C

CyberTaz

Perhaps it's just me being thick, but since there have been no other
suggestions allow me to suggest that perhaps it isn't really clear what is
encompassed by the term "transpose". Can you clarify your need more
distinctly? I'm having a problem visualizing a need to transpose characters
that wouldn't be addressed by Spell Check or AutoCorrect.

Regards |:>)
Bob Jones
[MVP] Office:Mac
 
A

AstroGuy

Oh, nothing major-- just the usual switching of two adjacent letters. For example, "teh" to "the". I know that AC has several transpositions built in.

I recently discovered two tips--one by you even I believe-- that pertained to using AutoCorrect in two ways that I haven't.

1) As an abbreviation expander-- type sfg and it could automatically expand to "state and federal governments"-- that's handy if one is repeatedly using the same phrase.

2) As a way to correct character transpositions. If the on-screen spell checker flags a transposition, right-click it or control-click it, and chose AC and have it learn the error.

So the 2nd is a way of doing this, but often it's an unusual error, a novel word, an infrequent occurrence, so one simply wants to do a control-t or other quick command (in my case I used control-a) that switches the two letters.

But I'm often transposing and one doesn't want to take the time to do AC or have it learn the rare example and fill itself up (and corrupt things in process!).

A simple control-a macro, as I've defined in iKey, works nicely, but could be faster.

Appreciate the reply! Hope you had a good Thanksgiving!
 
J

John McGhie

Hi Bob:

Oh, I know what he wants :) I just do not believe there is a convenient
way to do it in Word 2008.

It's either use AutoCorrect, or nothing.

Some techwriters use a VBA macro that was written many years ago. It simply
takes the letter to the left of the cursor and swaps it with the one two to
the left.

http://word.tips.net/Pages/T000454_Transposing_Two_Characters.html

Cheers


Perhaps it's just me being thick, but since there have been no other
suggestions allow me to suggest that perhaps it isn't really clear what is
encompassed by the term "transpose". Can you clarify your need more
distinctly? I'm having a problem visualizing a need to transpose characters
that wouldn't be addressed by Spell Check or AutoCorrect.

Regards |:>)
Bob Jones
[MVP] Office:Mac

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 
C

CyberTaz

I figured as much but was just hoping we could take the *easy* way out ;-)

Regards |:>)
Bob Jones
[MVP] Office:Mac
 
A

AstroGuy

Right you both are! My iKey macro is working fine, though I can see it highlight the letter and do its thing! I've explored AS for a bit, and can even do some selection of words or paragraphs (or was that in TextEdit?) In any event, maybe I'll keep hunting for an AS example of selecting characters in Word and moving text!

But in the meantime, iKey works! But if any of you come across an AppleScript that does letter transposition or something akin to that, please post a link or the actual example. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top