|Jul 3, 2009, 03:34 PM||#1|
Don't know where to begin
I know almost nothing about how to write apple scripts but I think I'm going to have to learn some basics.
I'm running Office 2008 for Mac on a G5 Leopard. I just switched from a PC where I was using Word 2007. Since Word 2008 does not have macros I'm lost trying to convert make two of my often-used macros.
One is to cap the first letter of a word, say "john" to make it read "John." In 2007 I wrote a macro telling the program to go to the beginning of the word, select the letter, cap and then go to the end of the word.
The other was to transpose letters, say in the word "amke" to make it read "make." (Autocorrect is one way of doing this but AC doesn't always apply). I wrote a macro so if I placed my cursor between the "m" and the "k" in "amke", the macro would move one space to the left, do a CTRL-X, go one space to the right and do a CTRL-V, then go to the end of the word.
Can anyone tell me a way to do this in script without having to learn the language? At least the commands necessary.
|Jul 3, 2009, 04:25 PM||#2|
Without Word, I don't have its scripting dictionary so I can't be the greatest help.
But there is one thing you can try now ...
Open Word and have a document up on the screen with text in the document.
Open Script Editor. It's inside the AppleScript folder inside Applications.
Click the button in the upper left corner called "Record"
Go back to Word. Using only the keyboard, select one letter, cut, hit the left arrow, hit paste (transpose the two characters).
Now return to Script Editor.
If Word is all it's cracked up to be, you should have your script.
If nothing's there, it means Word isn't scriptable and Steve Ballmer should be forced to eat your Mac.
The capitalization routine will be a little trickier.
(Assuming the first one was successful)
Use the keyboard to move the cursor to the beginning of a word.
Select the character.
Now return to Script Editor.
You'll need to add code that will look like this (though I can't guarantee this works):
get the selection of window 1
set asciiNum to the ascii number of it
if asciiNum > 96 then
set the selection of window 1 to the ascii character (asciiNum-32)
BTW, you might not find AS's performance inside Word acceptable, especially for simple character manipulation. You might want to explore something like QuicKeys or Word's own commands. Isn't there a Title case command that capitalizes the first letter of a word? Add a hotkey to that and you'll be in business.
What looks large from a distance, close up ain't never that big.
|Jul 4, 2009, 09:04 AM||#3|
What I obviously lack is a knowledge of how to write commands in AS. Can you recommend a book for newbies containing only the basics?
|Jul 4, 2009, 09:36 AM||#4|
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|I really dont know where to begin||Walter Bell||Mac Programming||9||Aug 26, 2011 04:07 PM|
|iAd help - I know what but I don't know where to put the code.||Mitch1984||iPhone/iPad Programming||0||Mar 14, 2011 04:58 AM|
|I'm so lost I don't know where to begin. (Yet another newbie thread)||krye||Mac Programming||26||Jul 25, 2008 01:04 AM|
|Help! I love apple but dont know where to begin!||darylkotze||Buying Tips and Advice||3||May 4, 2008 03:42 PM|
|I don't know where to put this... but I need help with Keynote + outputting to a TV||Chone||Mac Applications and Mac App Store||0||Nov 11, 2006 11:15 AM|
All times are GMT -5. The time now is 07:48 PM.